M
Mel
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
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