I am converting a worksheet to PDF using the solution from thread707-416330 how ever I get a argument not found error on PrToFileName argument of PrintOut, could this be because of i am using Excel 8?
Anyone know of solutions other than sendkeys as this will not be possible.
Code:
Sub CommandButton1()
' Define the postscript file name.
Dim PSFileName As String
PSFileName = "F:\Zip\In\myPostScript.ps"
' Print the Excel range to the postscript file
Dim MySheet As Worksheet
Set MySheet = ActiveSheet
MySheet.PrintOut copies:=1, preview:=False, ActivePrinter:="Acrobat Distiller", printtofile:=True, collate:=True, PrToFileName:=PSFileName
End Sub
Anyone know of solutions other than sendkeys as this will not be possible.
Code:
Sub CommandButton1()
' Define the postscript file name.
Dim PSFileName As String
PSFileName = "F:\Zip\In\myPostScript.ps"
' Print the Excel range to the postscript file
Dim MySheet As Worksheet
Set MySheet = ActiveSheet
MySheet.PrintOut copies:=1, preview:=False, ActivePrinter:="Acrobat Distiller", printtofile:=True, collate:=True, PrToFileName:=PSFileName
End Sub