ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Save as PDF (https://www.excelbanter.com/excel-programming/408886-save-pdf.html)

richzip

Save as PDF
 
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.

Jim May

Save as PDF
 
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

"richzip" wrote:

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.


Ivyleaf

Save as PDF
 
On Apr 6, 7:05*am, Jim May wrote:
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



"richzip" wrote:
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.- Hide quoted text -


- 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/d...displaylang=en

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

Cheers,
Ivan.


All times are GMT +1. The time now is 09:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com