Creating a PDF in Excel Automatically

Brittany

New Member
Joined
Apr 14, 2003
Messages
7
I have a function within MS Access that automatically creates an Excel spreadsheet. Then I have it automatically create a PDF with the following code:

SendKeys pdf_file_name & "{Enter}", False
xlWrkbk.PrintOut Copies:=1, ActivePrinter:="Acrobat Distiller on Ne00:", Collate:=True

The "SendKeys" appears to cause some problems. Does anyone know of another way to create a PDF without using "SendKeys"?
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
I seem to remember that you can configure Distiller so it won't prompt you for a filename ? and it will put the printed file in the \Output\ folder of the Acrobat folder... That way you wouldn't have to use Sendkeys to send the filename...
 
Upvote 0

Forum statistics

Threads
1,221,706
Messages
6,161,406
Members
451,702
Latest member
Kc3475

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