Print to PDF

mysterious-dr-x

Board Regular
Joined
Jul 29, 2011
Messages
51
I'm looking to create a macro that will print a worksheet to .pdf, thus far I have the following;

Code:
Sub SavePDF()
    ActiveWindow.SelectedSheets.PrintOut From:=1, To:=2, Copies:=1
End Sub
Which isn't much I know, although it does work, so atleast there is that. Having said that, it only prints using whichever printer was last used.

How do I define that I want it to print to pdf?

In addition, I'd like the file name (from a specified cell) & save location (sub folder in same place as original excel doc) to be automatically detected, but for the user to ok them. I was going to do this using a form which I am about to go & develop, however, I've already looked into this & don't really know where to go in terms of code, so any help would be appreciated.

NB. The name of our .pdf printer is "PDF Complete"
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Why don't you download PDFCreator? I doubt you'll get a solution for PDF Complete, particularly the automation of naming the file.
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,134
Members
452,890
Latest member
Nikhil Ramesh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top