Create folder and save worksheet as pdf

  • Re: Create folder and save worksheet as pdf


    Thanks royUK
    Running Excel 2013
    I have look at a lot of examples and can not find what I want. When I click on a button it will-
    1. go to the folder(Folder value is in C13)
    2. put the file name in the file dialog box with the value in C16
    3. Save to the folder as a pdf.

  • Re: Create folder and save worksheet as pdf


    This is a code I use to make a Folder named what ever is on B2


    Code
    Dim d As String, s As String, ds As String
    
    
        s = "S:\Stairs\Stair Productions\"
        d = Range("B2")
        ds = s & d
        Application.DisplayAlerts = False
        Application.EnableEvents = False
        If Dir(ds & client, vbDirectory) = "" Then MkDir ds
  • Re: Create folder and save worksheet as pdf


    Thanks davesexcel
    not have problem with making folder, having problem with saving the worksheet as pdf in the right folder. C13 is the folder name and c16 is the workbook name. Want to
    click button and open to correct folder by value in C13 and the workbook name in C16 is in the save as dialog box to save as PDF. Here is what I use to make folder


  • Re: Create folder and save worksheet as pdf


    Okay,
    Well here is what I use to PDF my workbook

    Code
    Dim d As String, s As String, ds As String
        s = "S:\Stairs\Stair Productions\"
        d = Range("B2")
        ds = s & d
        ChDir "S:\"
        ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
                                           ds & "\" & d & ".pdf", Quality:=xlQualityStandard, IncludeDocProperties:=True, _
                                           IgnorePrintAreas:=False, OpenAfterPublish:=True

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!