kualjo
01-07-2016, 07:25 AM
I am trying to create individual files from a master file based on a selection variable. Once those files are created, I want to save them in PDF format. I'm using the following code :
Sheets(k).Select
Sheets(k).Copy
ActiveWorkbook.SaveAs Filename:=FolderName & "/" & ActiveSheet.Name, FileFormat:=xlTypePDF, CreateBackup:=False
ActiveWorkbook.Save
ActiveWorkbook.Close
I was originally using FileFormat:=xlOpenXMLWorkbook, and that worked fine. Changing it to PDF, however, causes an error. Is there something I need to modify in order to accommodate the change to PDF?
Sheets(k).Select
Sheets(k).Copy
ActiveWorkbook.SaveAs Filename:=FolderName & "/" & ActiveSheet.Name, FileFormat:=xlTypePDF, CreateBackup:=False
ActiveWorkbook.Save
ActiveWorkbook.Close
I was originally using FileFormat:=xlOpenXMLWorkbook, and that worked fine. Changing it to PDF, however, causes an error. Is there something I need to modify in order to accommodate the change to PDF?