code to print (save) pdf from excel

todd ioi

New Member
Joined
Oct 17, 2006
Messages
5
i need a code I can put into one of my macros which will

activate print (the print area has already been set)
save as pdf
name the pdf document the value (or text) of a cell on the worksheet
return to the active worksheet in excel


Right now the macro stops and I have to manually do the above.

anybody who can help thank you[/b]
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
What program do you use to save the file as a pdf? As far as I know you cannot print to a pdf file in excel without an add -on like cutePDF or AdobePDf.

I tried recording a macro to print to Cute PDF and can get as far as asking for a file name. I don't know how you would pass a value of file name to this addtional add on program.

Maybe someone else can answer this.

Good Luck

Hayden
 
Upvote 0
I do have Adobe Reader 6.0 for macintosh, which is the platform I am working under. I have batches of 100 unique worksheets to save to pdf format, to email to 100 100 different clients. Right now I have to do print-pdf-save as pdf-enter a unique name, which is also on a cell on the worksheet, and then run a macro to generate the next unique worksheet and ect... Though I never seem to actually leave the excel program, it does not record when going into print. Open for ideas.

todd
 
Upvote 0
as near as i can tell there are thousands of people out there who have *almost* made it work... either useing VBA or Applescript.

I have never been able to get this to work using VBA and moved on to see if I could get an AppleScript to do it for me.

Long story short, I fall into the *almost* category as well! The closest I got came from here: http://bbs.applescript.net/viewtopic.php?pid=65630

Good Luck, and if you find anything be sure to let us know!
 
Upvote 0
Thannk you. I have not dealt with applescript but it looks like I will be looking at it.

Thanks again for taking the time.

Todd
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,817
Members
449,049
Latest member
cybersurfer5000

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