Print to PDF using VBA

Ash3d

New Member
Joined
Feb 8, 2013
Messages
6
Hey guys!

I'm fairly new to VBA so forgive me if I sound all confused. I have a worksheet in excel which I need to print out as a PDF file. Is there any way I can do this? Is there a function I can use to output the information on the sheet as a PDF file in VBA?

Please let me know!

Thanks! :biggrin:

-Ash
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
What version of Excel are you using?



Hey guys!

I'm fairly new to VBA so forgive me if I sound all confused. I have a worksheet in excel which I need to print out as a PDF file. Is there any way I can do this? Is there a function I can use to output the information on the sheet as a PDF file in VBA?

Please let me know!

Thanks! :biggrin:

-Ash
 
Upvote 0
You don't need vba to print to PDF.

Click on File,
then select Save & Send,
then select Create PDF/XPS Document,
then check options (only active sheet),
then Publish
 
Upvote 0
Actually, you're right! I could just automate the process using a macro.

Thanks!

And I apologize for my lack of common sense :p. Its been a long day.

You don't need vba to print to PDF.

Click on File,
then select Save & Send,
then select Create PDF/XPS Document,
then check options (only active sheet),
then Publish
 
Upvote 0
I have an add-on question to this thread. I need to produce reports from Excel for several hundred clients, all numbered 001 through 400+.

On my report I’m viewing 1 cell on another sheet that pulls this information in. This is done with the following: =CONCATENATE("ID# ",'Master -Data'!A67,)

The Save As dialog comes up with the file name. I want to append this with the client number without the ID# (actually SpaceDashSpaceClientnumber).

So, Monthly Client Report June 2013.xlsx would show in the Save As dialog as Monthly Client Report June 2013 - 001.xlsx

Is there an easy way to do this?

TIA-DD
 
Upvote 0

Forum statistics

Threads
1,214,878
Messages
6,122,062
Members
449,064
Latest member
scottdog129

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