I know this is similar to topics I saw here, unfortunately I have a slight twist...
I'm trying to write a macro in Excel to print the sheet to a PDF with a filename that is chosen from a cell. I would however like to give the user the option to make slight tweaks to the filename. The user does things in a fairly standard way and can avoid retyping everything if it's mostly automated.
I have been bungling around grabbing code and I have written a macro that does everything I want except pull up the prompt and allow changes to be made.
Is this possible? Here's what I've got so far.
Thanks.
I'm trying to write a macro in Excel to print the sheet to a PDF with a filename that is chosen from a cell. I would however like to give the user the option to make slight tweaks to the filename. The user does things in a fairly standard way and can avoid retyping everything if it's mostly automated.
I have been bungling around grabbing code and I have written a macro that does everything I want except pull up the prompt and allow changes to be made.
Is this possible? Here's what I've got so far.
PHP:
Sub PrintPDF()
Set MySheet = ActiveSheet
Filename = ActiveSheet.Range("K7").Value
tempPSFileName = Filename & ".ps"
tempPDFFileName = Filename & ".pdf"
tempLogFileName = Filename & ".log"
MySheet.PrintOut Copies:=1, preview:=False, ActivePrinter:="Adobe PDF", printtofile:=True, Collate:=True, prtofilename:=tempPSFileName
Dim myPDFDist As New PdfDistiller
myPDFDist.FileToPDF tempPSFileName, tempPDFFileName, tempShowWindow
Kill tempPSFileName
Kill tempLogFileName
End Sub
Thanks.