Save as PDF

R

richzip

I have macro code set up to take data from a large workbook, and generate
separate xls files for each employee's data. It currently saves it as an xls
file. However, is there a code I can add that will also save it as a pdf
file in the same folder? I would like to give the employees the choice to
view either .xls or .pdf.
 
J

Jim May

I use this -- maybe you can adapt it to your needs:

Private Sub CommandButton1_Click()
Dim Progname As String
Dim MyFile As String
Progname = "C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe"
MyFile = "C:\Documents and Settings\Jim May\My Documents\test.pdf"
Shell Progname & " " & MyFile, vbNormalFocus
End Sub
 
I

Ivyleaf

I use this -- maybe you can adapt it to your needs:

Private Sub CommandButton1_Click()
Dim Progname As String
Dim MyFile As String
Progname = "C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe"
MyFile = "C:\Documents and Settings\Jim May\My Documents\test.pdf"
Shell Progname & " " & MyFile, vbNormalFocus
End Sub





- Show quoted text -

Hi,

Jim's code should OPEN an existing PDF file, but it won't save a
workbook as a PDF which I believe is what you are after. There is
nothing built into Excel that will do this, unless you have version
2007, in which case you can download this:

http://www.microsoft.com/downloads/...11-3E7E-4AE6-B059-A2E79ED87041&displaylang=en

Otherwise, have a look around on the net and you should find some
other solutions using third party addins.

Cheers,
Ivan.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top