R
Riccardo
Hy all,
i do a macro under ms word connet to a button that save a word file
to a ps with a "Default PostScript Printer"
Now i must do this under excel but i don't find an example that help
me.
I find this vba code:
Private Sub CommandButton1_Click()
' Define the postscript and .pdf file names.
Dim PSFileName as String
Dim PDFFileName as String
PSFileName = "c:\myPostScript.ps"
PDFFileName = "c:\myPDF.pdf"
' Print the Excel range to the postscript file
Dim MySheet As WorkSheet
Set MySheet = ActiveSheet
MySheet.Range("myRange").PrintOut copies:=1, preview:=False,
ActivePrinter:="Acrobat Distiller", printtofile:=True, collate:=True,
prttofilename:=PSFileName
' Convert the postscript file to .pdf
Dim myPDF As PdfDistiller
Set myPDF = New PdfDistiller
myPDF.FileToPDF PSFileName, PDFFileName, ""
End Sub
but it return an error with prttofilename:=PSFileName
Anyone have a valid source?
Tnx a lot
Bye
Riccardo
i do a macro under ms word connet to a button that save a word file
to a ps with a "Default PostScript Printer"
Now i must do this under excel but i don't find an example that help
me.
I find this vba code:
Private Sub CommandButton1_Click()
' Define the postscript and .pdf file names.
Dim PSFileName as String
Dim PDFFileName as String
PSFileName = "c:\myPostScript.ps"
PDFFileName = "c:\myPDF.pdf"
' Print the Excel range to the postscript file
Dim MySheet As WorkSheet
Set MySheet = ActiveSheet
MySheet.Range("myRange").PrintOut copies:=1, preview:=False,
ActivePrinter:="Acrobat Distiller", printtofile:=True, collate:=True,
prttofilename:=PSFileName
' Convert the postscript file to .pdf
Dim myPDF As PdfDistiller
Set myPDF = New PdfDistiller
myPDF.FileToPDF PSFileName, PDFFileName, ""
End Sub
but it return an error with prttofilename:=PSFileName
Anyone have a valid source?
Tnx a lot
Bye
Riccardo