VBA - Print to PDF Automatically

dkauf

Board Regular
Joined
Sep 23, 2008
Messages
68
I am trying to find some VBA code that I can utilize in an Excel report that I want to run automatically each night. I plan to utilize Windows Scheduler to email the results of this report to certain individuals on a daily basis, but I only want them to see the results in PDF. Thus, I need to figure out how to write a script that will print the spreadsheet to PDF (this includes selecting the CutePDF printer in the event another actual printer is selected), name the file "XXXXX (where XXXXX is a link to a cell in the worksheet).pdf" in a specified directory, and effectively pressing "OK" that pops up when you designate the location to save the PDF.

I am quite a novice when it comes to VBA (I'm learning) and would appreciate any ideas you all may have.

Thanks!
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

Forum statistics

Threads
1,224,527
Messages
6,179,331
Members
452,907
Latest member
Roland Deschain

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