Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Activeprinter | Excel Programming | |||
application.activeprinter and network device | Excel Programming | |||
PrintOut Method, Set ActivePrinter with a variable | Excel Programming | |||
VBA ActivePrinter | Excel Programming | |||
Application.ActivePrinter??? | Excel Programming |