Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
Hi,
I am using a macro to create a report and the last step is to print a particular worksheet using a PDF maker. I have figured out how to specify the printer as being the PDF maker, but I also want to be able to automatically enter the file name and path, which I will build within the macro depending upon some user inputs. I've built the text strings as I need, I just need to be able to "feed" them to the PDF maker rather than have the dialog box come up and ask the user for that information. Any help? Bill |
#2
![]() |
|||
|
|||
![]()
Hi Bill,
I stumbled in here today to find the answer to a similar question. I also am creating a macro to automatically print Excel worksheets to pdf. The following is what I have so far in part of my macro: Application.ActivePrinter = "Adobe PDF on Ne00:" If XStr = "X" Then Application.Run AppStr Sheets("SUMMARY").Select ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, PrToFileName:="C:\Documents and Settings\marusichd\Desktop\Email Worksheets\" & CoName & ".pdf" Sheets("FLEET").Select ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, PrToFileName:="C:\Documents and Settings\marusichd\Desktop\Email Worksheets\" & CoName & "2.pdf" Sheets("SELECT TO PRINT").Select End If It seems to work ok up to a point. The pdf file is created in the selected location, however the file is empty (0 KB) or when opened states it is corrupt. !?! This is what I was looking for help on. Did you get anything to work out? Thanx, Darcy :o) "Bill" wrote: Hi, I am using a macro to create a report and the last step is to print a particular worksheet using a PDF maker. I have figured out how to specify the printer as being the PDF maker, but I also want to be able to automatically enter the file name and path, which I will build within the macro depending upon some user inputs. I've built the text strings as I need, I just need to be able to "feed" them to the PDF maker rather than have the dialog box come up and ask the user for that information. Any help? Bill |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
open file (as variable) from macro | Excel Discussion (Misc queries) | |||
Opening a file with a Macro | Excel Discussion (Misc queries) | |||
How do I insert the directory path in my Excel file? | Excel Worksheet Functions | |||
Reflect file path (show drive letters) in Excel 2000 | Excel Discussion (Misc queries) | |||
How to change the Excel Title Bar to show the full file path na... | Excel Discussion (Misc queries) |