SaltyWalty
New Member
- Joined
- Jun 2, 2014
- Messages
- 3
I have been trying over and over to get a script to work from this forum but with no success. I'm reaching out to know why I cant get this to work. The script is as Follows:
Option Explicit
Sub Automatic_Save_As()
Dim TempPDFFileName As String
Dim tempPSFileName As String
Dim tempPDFRawFileName As String
Dim tempLogFileName As String
TempPDFFileName = "C:\Desktop\Test" & Range("D2").Value
tempPSFileName = tempPDFRawFileName & ".ps"
TempPDFFileName = tempPDFRawFileName & ".pdf"
tempLogFileName = tempPDFRawFileName & ".log"
ActiveSheet.PrintOut Copies:=1, preview:=False, ActivePrinter:="Adobe PDF", printtofile:=True, Collate:=True, prtofilename:=tempPSFileName
Dim myPDFDist As New PdfDistiller
myPDFDist.FileToPDF tempPSFileName, TempPDFFileName, ""
End Sub
I'm running widows 7, office 2010 and have adobe acrobrat XI Pro.
No errors are generated when I run the Macro, but It doesn't print in the specified file location.
Any help would be greatly appreciated.
Option Explicit
Sub Automatic_Save_As()
Dim TempPDFFileName As String
Dim tempPSFileName As String
Dim tempPDFRawFileName As String
Dim tempLogFileName As String
TempPDFFileName = "C:\Desktop\Test" & Range("D2").Value
tempPSFileName = tempPDFRawFileName & ".ps"
TempPDFFileName = tempPDFRawFileName & ".pdf"
tempLogFileName = tempPDFRawFileName & ".log"
ActiveSheet.PrintOut Copies:=1, preview:=False, ActivePrinter:="Adobe PDF", printtofile:=True, Collate:=True, prtofilename:=tempPSFileName
Dim myPDFDist As New PdfDistiller
myPDFDist.FileToPDF tempPSFileName, TempPDFFileName, ""
End Sub
I'm running widows 7, office 2010 and have adobe acrobrat XI Pro.
No errors are generated when I run the Macro, but It doesn't print in the specified file location.
Any help would be greatly appreciated.