Excel VBA and doPDF

You can ask general questions, share opinions or advices about doPDF.
Posts: 2
Joined: Wed Jun 18, 2008 4:20 am

Postby Candu » Wed Jun 18, 2008 11:25 am

I am very impressed with doPDF. I am adept at Excel & VBA macros but can't figure out if/how I can pre-populate the PDF filename in the pop-up box. Is this possible?

I am changing the printer to doPDF then running:

Sheets(Array("sheet1", "sheet4", "sheet6")).Select

ActiveWindow.SelectedSheets.PrintOut copies:=1, Collate:=True

This works fine but I'd like to populate the name field.

Posts: 1445
Joined: Thu May 23, 2013 7:19 am

Postby Softland » Wed Jun 18, 2008 11:50 am

Sorry but not from the code directly. Normally another parameter should set the name automatically, prtofilename:="c:\test.pdf", but since that also requires to set a path it's not supported (it would mean bypassing the save as window).

However, note that doPDF always prints the pdf with a filename that's actually the name of the opened workbook, so you'll simply have to name your workbook the way you want it shown in the PDF.

Return to “General”