Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
mel mel is offline
external usenet poster
 
Posts: 6
Default Printing to PDF Goes to Wrong Drive/Folder

I wrote a simple macro to print the active sheet to the
PDF printer. I want to always print to the same folder on
my G drive, however, if my last manual file operation
such as a file saveas or file open was browsed to another
drive then the PDF file always goes to that drive. I use
a statement chdrive "g:" in my macro, but it seems that
this is ignored and it goes back to the last drive
manually accessed without any error. It seems like my
chdrive statement is not affecting the overall system
default drive or something. Is there a workaround. TIA

Dim MyActivePrinter As String
MyActivePrinter = application.activeprinter 'save current
default printer name
ChDrive ("g:")' added this to make sure g drive is
selected
ChDir "g:\pdf" 'point to the right folder
Application.ActivePrinter = "Acrobat PDFWriter on LPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Application.ActivePrinter = MyActivePrinter ' reset the
default printer

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
Links to Local Drive Instead of Same Folder TKS_Mark Excel Discussion (Misc queries) 1 May 21st 09 06:07 AM
Folder Network drive Wanna Learn Excel Discussion (Misc queries) 1 May 30th 08 06:42 PM
add a folder to c:\ drive from cell A1 contents... [email protected] Excel Discussion (Misc queries) 1 July 25th 06 09:48 PM
How do I lock a folder on a shared drive ? Tony Brown Excel Discussion (Misc queries) 1 February 28th 05 07:48 AM
Pasting a range of information from a foler on F Drive to another folder on same drive Tom Ogilvy Excel Programming 1 August 3rd 03 01:50 AM


All times are GMT +1. The time now is 10:42 PM.

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

About Us

"It's about Microsoft Excel"