Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default Network printing

The code below is suppose to print a worksheet, but my problem is that it is
suppose to print to a specific network printer and that printer is not
always assigned
to Ne09. I have seen it be anything from Ne01 to Ne10.

Any way this code can be forced to look for the proper Ne##?. Unfortunately,
depending on the computer from which this is run, it is not normally the
default printer.

This is just a snippet of the code. The macro is much more involved

Sub Macro7()
'
' Macro7 Macro
' Macro recorded 8/28/2008 by wta
'

'
Application.ActivePrinter = "\\printserver1\ParaT_HPLJ_3800 on Ne09:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"\\printserver1\ParaT_HPLJ_3800 on Ne09:", Collate:=True

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,365
Default Network printing

Patrick,
I could definitely be wrong here, but this should at least be worth a try.
It seems to work just fine for me on my systems, but I'm not running in a
domain, just a workgroup.

First, just comment out or delete the first line where you're setting the
active printer - probably just as well, as then you've changed the default
printer for the user which may surprise them later when they expect their
printouts to go to a local printer or one that's a shorter walk away than the
one you want for your process. So
Application.ActivePrinter = "\\printserver1\ParaT_HPLJ_3800 on Ne09:"
becomes (commented out)
'Application.ActivePrinter = "\\printserver1\ParaT_HPLJ_3800 on Ne09:"

In the next line of code, change the name of the ActivePrinter:= to get rid
of the " on Ne09:" portion. Try the line like this:

ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"\\printserver1\ParaT_HPLJ_3800", Collate:=True

As I said, this works fine to push a printout on one of my systems with a
completely different printer set as the default printer over to a shared
printer on another system.

I think the trick is that all systems running your package will simply have
to have access to the \\printserver1\ParaT_HPLJ_3800 printer. If they are
connected to a HPLJ_3800 on another print server, it'll probably fail.

Now, there some really applicable and adaptable code showing how to find out
what printers are available on a system on this page:
http://word.mvps.org/faqs/MacrosVBA/...lePrinters.htm

In the Sub Test() routine, instead of listing the found printers via
Debug.Print you could modify the code to look for something like "HPLJ_3800"
in the printer names and save that entry to use in your .PrintOut line of
code for the ActivePrinter:= setting.



"Patrick C. Simonds" wrote:

The code below is suppose to print a worksheet, but my problem is that it is
suppose to print to a specific network printer and that printer is not
always assigned
to Ne09. I have seen it be anything from Ne01 to Ne10.

Any way this code can be forced to look for the proper Ne##?. Unfortunately,
depending on the computer from which this is run, it is not normally the
default printer.

This is just a snippet of the code. The macro is much more involved

Sub Macro7()
'
' Macro7 Macro
' Macro recorded 8/28/2008 by wta
'

'
Application.ActivePrinter = "\\printserver1\ParaT_HPLJ_3800 on Ne09:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"\\printserver1\ParaT_HPLJ_3800 on Ne09:", Collate:=True

End Sub


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,365
Default Network printing

Closed up shop a little too early. There is also some good code to help
enumerate the printers available on a system he
http://support.microsoft.com/kb/q166008/

Hope all of this helps you find a solution.


"Patrick C. Simonds" wrote:

The code below is suppose to print a worksheet, but my problem is that it is
suppose to print to a specific network printer and that printer is not
always assigned
to Ne09. I have seen it be anything from Ne01 to Ne10.

Any way this code can be forced to look for the proper Ne##?. Unfortunately,
depending on the computer from which this is run, it is not normally the
default printer.

This is just a snippet of the code. The macro is much more involved

Sub Macro7()
'
' Macro7 Macro
' Macro recorded 8/28/2008 by wta
'

'
Application.ActivePrinter = "\\printserver1\ParaT_HPLJ_3800 on Ne09:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"\\printserver1\ParaT_HPLJ_3800 on Ne09:", Collate:=True

End Sub


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
Printing macro i network Mia Excel Programming 7 March 2nd 10 06:07 PM
Excel 2003 printing problem--printing 1 document on 2 pages Bons Excel Discussion (Misc queries) 0 December 24th 09 04:15 PM
Printing on a network leerem Excel Discussion (Misc queries) 6 September 26th 08 07:36 PM
Enable Double sided printing contiuously when printing multiple s. Lee Excel Discussion (Misc queries) 1 November 27th 04 01:58 AM
Copying files ...Network to Network Eric[_6_] Excel Programming 2 July 18th 03 08:59 PM


All times are GMT +1. The time now is 03:43 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"