Printing to PDF + VBA. Help!

Joined
May 14, 2012
Messages
21
Reaction score
0
Hi,

Im trying to create a code which wil print the required excel sheets into a pdf file. I have built the code to arrange and select specific sheets to print but when Im trying to print into pdf, though the file is created but it doesnt open .. Im using the following code for it ..

ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:="Adobe PDF on Ne02:", Collate:=True, PrToFileName:=PDFExportPath & "\" & PDFFileName & ".pdf"


As mentioned, its creating the file but when i try to open it it gives an error that - acrobat could not open because it is either not a supported.

Can u think where is it goin wrong to decode this file?

Im have Excel 2003 and Adobe 8.0 on my computer.

Thanks!
 
Maybe you should use the SaveAs function to save to PDF. I'm not sure if that exists in excel 2003 but I know it does in 2010. I think you can automate the SaveAs function in VBA.
 
Maybe you should use the SaveAs function to save to PDF. I'm not sure if that exists in excel 2003 but I know it does in 2010. I think you can automate the SaveAs function in VBA.
The saveas PDF did not come until Office 2007
 
Back
Top