View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default ActivePrinter in Excel changes!

I assume you are using

Application.Activeprinter = "??"

This does not change anything in the actual workbook itself. It only changes
the instance of Excel (application) that you are currently working in... I am
not sure exactly what you are doing with this book... Do you run it and then
save it and distribute it to end users. If so then the active printer
associated with their application will be the one that is used...
--
HTH...

Jim Thomlinson


"GarySmith2" wrote:

The macro doesn't print - it just prepares it for printing so users can print
on their printer. The question a why does the activeprinter change? And
How can I prevent it from changing?

Thanks,
Gary..

"Jim Thomlinson" wrote:

Why not set the active printer in the Before_Print event in ThisWorkbook
instead of a t the beginning of execution?
--
HTH...

Jim Thomlinson


"GarySmith2" wrote:

During a long running excel macro that also sets page margins and headers, I
set the activeprinter at the start of the macro but it changes dynamically if
the system default printer changes during the macro's execution. This causes
the macro to fail. Is there some property that can be set to not allow the
activeprinter to be changed? The biggest problem occurs on terminal services
when a user logs off and are left without any default printer assignment
which causes excel to prompt for one. My macro runs unattended so it just
hangs waiting for user input.

Please help!