These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Syntax error Offending command

sarada
Registered: Jun 20 2007
Posts: 7

Hi,

I am trying to convert a few excel sheets to PDF from VBA. These sheets has print size reduced to 75%. I am doing this using VBA. I get the following error in the log

%%[ Error: syntaxerror; OffendingCommand: ) ]%%
%%[ Flushing: rest of job (to end-of-file) will be ignored ]%%
%%[ Warning: PostScript error. No PDF file produced. ] %%

I changed many things and got it working. But When closed down excel and restarted again, it failed.

Can anyone please help me out.

Thanks

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
It looks like you trying to print the Excel file directly with the Distiller program. This will not work. Distiller can only process PostScript input files and output PDF files. Adobe provides the PDF Maker macro within the MS Office products to convert MS Office products outputs to PS files and then passes that file to Distiller. You can either call the PDF Maker macro or create a PS file from the MS Office product and then distill that file.

George Kaiser

sarada
Registered: Jun 20 2007
Posts: 7
Thanks for your reply

This is the relevent bit of my code

gSummaryWS.PrintOut copies:=1, preview:=False, collate:=True, _
ActivePrinter:="Acrobat Distiller", _
printtofile:=True, prTofilename:=PSFileName

Dim myPDF As PdfDistiller
Set myPDF = New PdfDistiller
myPDF.FileToPDF PSFileName, PDFFileName, ""

It creates the ps file. But can't open it. Do i have to do something related to embed font settings. My sheet print % is less than 100%

Thanks in advance