Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default ActivePrinter in Excel changes!

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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default ActivePrinter in Excel changes!

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!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default ActivePrinter in Excel changes!

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!

  #4   Report Post  
Posted to microsoft.public.excel.programming
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!

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default ActivePrinter in Excel changes!

Yes I set it that way. My VB application runs in batch overnight to prepare
reports for end users. In order for my excel macro to format the xls file for
end user printing (setting margins, headers and landscape) it needs to have
an active printer set. Not an actual printer, it just needs a print driver
installed which the system has setup. This all works fine except that excel
will change the active printer to a terminal server user's printer. When this
user then logs off, the system is left without a default printer and excel
now has an invalid ActivePrinter, not the one I set.

This application is on Windows Server 2003 and Office 2003.

Thanks again,
Gary Smith

"Jim Thomlinson" wrote:

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!



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default ActivePrinter in Excel changes!

There is not much I can help you here. I don't think Excel really is the
problem here. It sounds more like an issue with the application being server
based and how the printers are being handled by the server. Or possibly it
has to do with restrictions placed on the application to allow/disallow users
from modifying (persistently) setting such as printers.
--
HTH...

Jim Thomlinson


"GarySmith2" wrote:

Yes I set it that way. My VB application runs in batch overnight to prepare
reports for end users. In order for my excel macro to format the xls file for
end user printing (setting margins, headers and landscape) it needs to have
an active printer set. Not an actual printer, it just needs a print driver
installed which the system has setup. This all works fine except that excel
will change the active printer to a terminal server user's printer. When this
user then logs off, the system is left without a default printer and excel
now has an invalid ActivePrinter, not the one I set.

This application is on Windows Server 2003 and Office 2003.

Thanks again,
Gary Smith

"Jim Thomlinson" wrote:

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!

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
Activeprinter ben Excel Programming 4 October 19th 05 02:36 PM
application.activeprinter and network device Edwin Niemoller[_2_] Excel Programming 2 September 19th 05 08:25 PM
PrintOut Method, Set ActivePrinter with a variable Neuraxis Excel Programming 3 March 1st 05 11:15 AM
VBA ActivePrinter POM Excel Programming 3 February 23rd 05 10:08 AM
Application.ActivePrinter??? Aldo Miele Excel Programming 1 September 7th 04 12:18 PM


All times are GMT +1. The time now is 10:09 AM.

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"