C
chowing0823
Hi all:
I am very new to excel vba and am facing some challenges with the
attempt to write a vba code to print a financial report in pdf format.
I currently have an adobe reader 5.0 and Excel 2003.
I was trying to use ghostscript as suggested on the other postings, but
somehow, I cannot get the conversion part of it right
Here's my code.
Sub test()
Dim psfile As String
'Dim myPDF As PdfDistiller
'psfile = "C:\Documents and Settings\dpoon\Desktop\" & "123" & ".ps"
Application.ActivePrinter = "VBA2PDF on file:"
mypdf.filetoPDF "C:\Documents and Settings\dpoon\Desktop\" & "123" &
".ps", "C:\Documents and Settings\dpoon\Desktop\" & "123" & ".pdf"
MsgBox ActivePrinter
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Preview:=False,
Printtofile:=True, Collate:=True, PrToFileName:=psfile
End Sub
VBA2PDF on file is the "printer" I created using HP Deskjet1200 ps
driver. I could crate the .ps file alright, but how can I convert the
..ps file to .pdf without a acrobat distiller? Where can I find
pdfdistiller as an object, so that I could assign "mypdf" as a
pdfdistiller?
Your help is greatly appreciated.
Dennis poon
I am very new to excel vba and am facing some challenges with the
attempt to write a vba code to print a financial report in pdf format.
I currently have an adobe reader 5.0 and Excel 2003.
I was trying to use ghostscript as suggested on the other postings, but
somehow, I cannot get the conversion part of it right
Here's my code.
Sub test()
Dim psfile As String
'Dim myPDF As PdfDistiller
'psfile = "C:\Documents and Settings\dpoon\Desktop\" & "123" & ".ps"
Application.ActivePrinter = "VBA2PDF on file:"
mypdf.filetoPDF "C:\Documents and Settings\dpoon\Desktop\" & "123" &
".ps", "C:\Documents and Settings\dpoon\Desktop\" & "123" & ".pdf"
MsgBox ActivePrinter
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Preview:=False,
Printtofile:=True, Collate:=True, PrToFileName:=psfile
End Sub
VBA2PDF on file is the "printer" I created using HP Deskjet1200 ps
driver. I could crate the .ps file alright, but how can I convert the
..ps file to .pdf without a acrobat distiller? Where can I find
pdfdistiller as an object, so that I could assign "mypdf" as a
pdfdistiller?
Your help is greatly appreciated.
Dennis poon