Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Bill
 
Posts: n/a
Default Macro - Feeding path and file name to PDF maker

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   Report Post  
Darcy
 
Posts: n/a
Default

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
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
open file (as variable) from macro d chaps Excel Discussion (Misc queries) 1 March 14th 05 11:57 PM
Opening a file with a Macro Adam1 Chicago Excel Discussion (Misc queries) 2 February 28th 05 10:13 PM
How do I insert the directory path in my Excel file? Insert a Directory Path in Header/Footer Excel Worksheet Functions 2 February 4th 05 09:23 PM
Reflect file path (show drive letters) in Excel 2000 Alicia Excel Discussion (Misc queries) 4 January 20th 05 06:49 PM
How to change the Excel Title Bar to show the full file path na... lmilkey8855 Excel Discussion (Misc queries) 2 January 6th 05 03:08 PM


All times are GMT +1. The time now is 07:25 PM.

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"