#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 477
Default 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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default 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.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Save, save as, page setup dimmed out in unprotected excel sheet? ccKeithJ Excel Discussion (Misc queries) 3 December 14th 07 07:07 PM
Command Button Save As Application.ExecuteExcel4Macro ("SAVE.AS?() Paul Dennis Excel Discussion (Misc queries) 5 September 18th 06 05:34 PM
Disable save, save as, but allow save via command button TimN Excel Programming 10 September 1st 06 07:05 PM
How to diasble save and save as menu but allow a save button hon123456 Excel Programming 1 June 12th 06 09:50 AM
Totally Disabling (^ save ) (Save as) and Save Icon – Which code do I use: harpscardiff[_10_] Excel Programming 8 November 10th 05 12:24 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"