Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strange Thing: Changing Activeprinter takes ages!

Status
Not open for further replies.

Dav136

Technical User
Oct 3, 2003
21
0
0
AT
I've got a VBA Macro, which is instantiated by a VBS whenever a file gets written on the harddisk of the computer.
The file (.DOC) is printed on one of many local (IP) printers.
However, quite often, the command to change Printer (Application.Activeprinter) takes 15 minutes or more, in debugging mode as well as when run in background.

I usually help myself by restarting the PC, but it won't last too long...

Any Ideas of what I can do?

David
 
Not sure this is any help but any calls to printers tend to take a looooong time. that's why accessing the PAGESETUP property takes a long time (in code) - because each bit of info is being sent to the printer and back

Rgds, Geoff

Never test the depth of water with both feet

Help us to help you by reading FAQ222-2244 before you ask a question
 
Thanks, but I'm talking about an abnormality - not the usual 2 or 3 seconds but 15 MINUTES !!

David
 
Could you clarify a bit more? This is a VB Script that looks for any write activity to the HD; when it does detect a write, it (assumably) waits for the write operation to finish; then....what? - determines what application is associated with the file, creates an instance of the application, loads the macro in that application, loads the file, changes the active printer (????) and then sends the print job to that printer?

Do I have this right?

Gerry
 
Nope, it's only about MS Word, and it's a Word VBA Macro thats started by VBS.

To make matters more simply, I run the VBA Macro in debug mode, and stepping through the line Application.Activeprinter = "MyPrinter" takes 15 minutes or longer.

I have already reinstalled the Printer Driver, still I can't figure out why it behaves like this sometimes.

David
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top