Connecting Tech Pros Worldwide Forums | Help | Site Map

MacOSX Excel: how to print to pdf through VBA

Newbie
 
Join Date: Sep 2009
Posts: 3
#1: Sep 4 '09
Hi!

Can you help with the following problem:
How to automate in Excel through VBA that a page is printed to PDF (=saved as PDF)
...this all in MacOSX

(Windows would need a PDF creator program). On a mac I can manually go to file->print and select "PDF" and save it as a PDF, now I would like this to happen with a VBA code.
...been stuck with this for 2 weeks already...

thanx

Member
 
Join Date: Mar 2009
Location: Conroe, TX
Posts: 57
#2: Sep 4 '09

re: MacOSX Excel: how to print to pdf through VBA


Have you looked at PDFTK. I am currently using it (PC though), but it supports Mac installation too. Free, and 1 line of code to convert, print, blah blah blah, check it out.
Newbie
 
Join Date: Sep 2009
Posts: 3
#3: Sep 4 '09

re: MacOSX Excel: how to print to pdf through VBA


Am lookng at PDFTK now,thx...but don't think that is my solution. This is what I am doing:
I have a personnel register in exel and I am calculating all the salaries there too. I want to make a PDF from the salarycalculation (this is what I will print to paper/ e-mail to the employees and save in a separate location on my harddisk).
At this time I have to manually save the calculation as PDF with every employee. It is a bit frustrating having to manually click print->PDF->save as and then write "Salarycalculation John Smith Sep 2009" with every employee and this surely can be done through VBA.
Newbie
 
Join Date: Sep 2009
Posts: 3
#4: Sep 4 '09

re: MacOSX Excel: how to print to pdf through VBA


Maybe this makes my question clearer:

I need a code in VBA that makes the following:
when I press a CommandButton (named CommanButton1) on a Userform the range (Sheet1!A1:E28) is saved as PDF (=printed as PDF).
This under MacOSX


Private Sub CommandButton1_Click()
' this code saves a range as PDF

End Sub
Reply