Hello,
I am using the following macro to save the current selected sheet as a PDF. When I go and edit the path I want it to save to it fails the macro and I think it has something to do with: ("userprofile") But if I create a folder on the desktop: \Holding\ it works fine.
I would like to be able to change this to the following path: C:\North\Transmission\Transmission Systems Logging\PDF Export
Also, I was wondering is there a way to adjust the macro to save all sheets to there own PDF files still using the sheet name and adding the current date at the end? This would make it so I would not need to click each sheet and run the macro, There is about 15 Sheets.
Thank You,
Bdenn
I am using the following macro to save the current selected sheet as a PDF. When I go and edit the path I want it to save to it fails the macro and I think it has something to do with: ("userprofile") But if I create a folder on the desktop: \Holding\ it works fine.
I would like to be able to change this to the following path: C:\North\Transmission\Transmission Systems Logging\PDF Export
Also, I was wondering is there a way to adjust the macro to save all sheets to there own PDF files still using the sheet name and adding the current date at the end? This would make it so I would not need to click each sheet and run the macro, There is about 15 Sheets.
Thank You,
Bdenn
VBA Code:
Sub Export_PDF()
' Saves active sheet as PDF file.
Dim FName As String
FName = Environ("userprofile") & "\Desktop\Holding\" & ActiveSheet.Name & " " & _
Format(Now(), "mm-dd-yyyy") & ".pdf"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=FName, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
End Sub