Hi there,
I'm just new on the forum and I would like to seek your help & advice how to make the macro work.
I have prepared a file with multiple sheets (90 to be exact). All these sheets need to be printed to PDF in separate files, each sheet a separate file. The PDF will have the name of the sheet as filename.
This is the code:
Sub SaveAsPDF()
Dim CurWorksheet As Worksheet
For Each CurWorksheet In ActiveWorkbook.Worksheets
CurWorksheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=Application.ActiveWorkbook.Path & “\” & CurWorksheet.Name, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
Next CurWorksheet
End Sub
When I run it, it gives a compiling syntax error. It points to the Sub SaveAsPDF() line.
Would you might know what is causing the error and can you help me fix it? Thanks a lot!
I'm just new on the forum and I would like to seek your help & advice how to make the macro work.
I have prepared a file with multiple sheets (90 to be exact). All these sheets need to be printed to PDF in separate files, each sheet a separate file. The PDF will have the name of the sheet as filename.
This is the code:
Sub SaveAsPDF()
Dim CurWorksheet As Worksheet
For Each CurWorksheet In ActiveWorkbook.Worksheets
CurWorksheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=Application.ActiveWorkbook.Path & “\” & CurWorksheet.Name, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
Next CurWorksheet
End Sub
When I run it, it gives a compiling syntax error. It points to the Sub SaveAsPDF() line.
Would you might know what is causing the error and can you help me fix it? Thanks a lot!