I'm using Microsoft Excel for Microsoft 365 MSO (16.0.13929.20222) 64-bit
On Windows 10 Pro 20H2 build 19042.928
On a desktop PC using an Intel CPU on an Intel system board
The workflow requires the user to visually check an Excel print preview before creating a "Microsoft Print to PDF" PDF file and
to visually double check the storage directory and PDF file name before saving the PDF file.
When the Excel Macro below is run, a print preview is displayed... providing the user an opportunity to visually check the print out before it actually generates a PDF printout to be stored in the appropriate storage directory with the correct file name.
If "Print" is clicked on, the "Save Print Output As" dialog box is displayed.
Unfortunately, this displays the directory of where the last (previous) Excel "Microsoft Print to PDF" printer file was saved - not, where the file should actually be saved.
The correct directory name to save the PDF print file in is something like E:\LOC567 in this example and the correct PDF file name is something like FN763.PDF.
Sub Macro_y()
Excel.Application.ActivePrinter = "Microsoft Print to PDF on Ne00:"
Excel.Application.ActiveSheet.Range(Cells(1, 1), Cells(25, H)).Select
Excel.Application.Selection.PrintPreview EnableChanges:=True
End Sub
How can the "Save Print Output As" dialog box be set to be at the correct storage directory (e.g. E:\LOC567) and also with the file name box filled in with the correct PDF file name (e,g, FN763.PDF)?
On Windows 10 Pro 20H2 build 19042.928
On a desktop PC using an Intel CPU on an Intel system board
The workflow requires the user to visually check an Excel print preview before creating a "Microsoft Print to PDF" PDF file and
to visually double check the storage directory and PDF file name before saving the PDF file.
When the Excel Macro below is run, a print preview is displayed... providing the user an opportunity to visually check the print out before it actually generates a PDF printout to be stored in the appropriate storage directory with the correct file name.
If "Print" is clicked on, the "Save Print Output As" dialog box is displayed.
Unfortunately, this displays the directory of where the last (previous) Excel "Microsoft Print to PDF" printer file was saved - not, where the file should actually be saved.
The correct directory name to save the PDF print file in is something like E:\LOC567 in this example and the correct PDF file name is something like FN763.PDF.
Sub Macro_y()
Excel.Application.ActivePrinter = "Microsoft Print to PDF on Ne00:"
Excel.Application.ActiveSheet.Range(Cells(1, 1), Cells(25, H)).Select
Excel.Application.Selection.PrintPreview EnableChanges:=True
End Sub
How can the "Save Print Output As" dialog box be set to be at the correct storage directory (e.g. E:\LOC567) and also with the file name box filled in with the correct PDF file name (e,g, FN763.PDF)?