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]
 

Some videos you may like

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

hayden

Board Regular
Joined
Sep 23, 2005
Messages
159
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
 

todd ioi

New Member
Joined
Oct 17, 2006
Messages
5
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
 

cmhoz

Active Member
Joined
Aug 20, 2006
Messages
268
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!
 

todd ioi

New Member
Joined
Oct 17, 2006
Messages
5
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
 

Watch MrExcel Video

Forum statistics

Threads
1,111,908
Messages
5,541,529
Members
410,547
Latest member
htran4
Top