Hello,

I have a program created in VB6 that creates an Excel spreadsheet and i want to save it as a .pdf instead of a .xls file.

I have tried multiple ways of coding it but nothing seams to work. Below is the way that seems closest to working...

PDF Code:
  1. Dim p As String
  2. Dim myPDF As PdfDistiller
  3. Dim xBook As String  'Contains name of createad workbook
  4.    
  5. p = "Acrobat Distiller on Ne00:"
  6.    
  7. xApp.Workbooks(xBook).PrintOut ActivePrinter:=p, printtofile:=True, prToFileName:="c:\mypostscript.ps"
  8.  
  9. Set myPDF = New PdfDistiller
  10. myPDF.FileToPDF "c:\mypostscript.ps", "G:\MVBS\Final mvbs\" & Format(Info.xYear, "0000") & "\" & Format(rsProp!entity_num) & ".pdf", ""
  11. Set myPDF = Nothing

It just creates a .log file with the following errors in it...

Code:
%%[ Error: undefined; OffendingCommand: E*t600R&u600D*r0F&l0o&l2A&l7H&l0S&l1X&l8c1E*p0x0Y*c0t5760x7680Y*b0M ]%%
%%[ Flushing: rest of job (to end-of-file) will be ignored ]%%
%%[ Warning: PostScript error. No PDF file produced. ] %%
I'm not sure what is going wrong or how to accomplish what I'm trying to do. I have read several posts and a lot have similar code, but I can't get it to work. Maybe I am missing a particular reference??

Any help is appreciated.

Thanks!