Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Feb 2010
    Location
    Denver, CO
    Posts
    191
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ActivePrinter and 'Ne01' designation (Excel 2002 (xp) SP2)

    I have a question regarding using the <font color=blue>Application.ActivePrinter</font color=blue> property. My problem has to do with the port designation at the end of the printer name. I have searched through the archives and found several references to this in the past, but nothing seems to answer the question.

    I am needing to print my document to a specific printer and am using <font color=blue>Application.ActivePrinter="printername on Ne01".</font color=blue> The problem, as has been noted previously, is that the "Ne01" designation appears to change without reason (OK, there is probably a reason, but I couldn't figure it out). Is there a way to just use the printername and not the port, or is there a way to wildcard the port numbers?? If there is, I couldn't figure it out, but most of you are way smarter than I am.

    Any thoughts on this would be greatly appreciated.

  2. #2
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ActivePrinter and 'Ne01' designation (Excel 2002 (xp) SP2)

    Randall,

    The Net01 has to do with how your LAN assigns the shared printers.

    Try the following code:

    Sub TestPrinter()
    tmp = Application.Dialogs(xlDialogPrinterSetup).Show
    If tmp = True Then
    'Enter Code Here
    End If
    End Sub


    John

  3. #3
    2 Star Lounger
    Join Date
    Feb 2010
    Location
    Denver, CO
    Posts
    191
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ActivePrinter and 'Ne01' designation (Excel 2002 (xp) SP2)

    John--

    Thanks for your response. However, I'm not sure what the code you presented is suppose to do. As far as I can tell, as long as the Printers Dialog can show, my code will fire. I think I'm looking for something more than that.

    I'm need to make sure we're talking about this same thing, first. You referenced Net01, while I'm refering to a printer port designation of Ne00, Ne01, Ne02,... Is this what you meant?

    I need to make sure my excel document prints to a specific printer. In the printers dialog box, it is refered to as <font color=blue>printername</font color=blue>. When I check the Application.ActivePrinter property, it returns <font color=blue>printername on Ne0x</font color=blue>, where <font color=blue>x</font color=blue> varies, but is usually 0, 1 or 2. I don't know how to refer to this printer if the name of the printer changes.

    Do you (or anyone else) have other suggestions? Or have I misunderstood the use of your code? I good at doing that!

  4. #4
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ActivePrinter and 'Ne01' designation (Excel 2002 (xp) SP2)

    A couple of thoughts:

    1] I had a similar problem once which I solved by running a For.. ...Next loop, substituting 0, 1, 2 etc. in the "Ne0x" string - you need to turn off or catch the Error reporting, and may not work if you have multiple networked printers.

    2] There is an application I use called DefPrint which is a command line app for changing the default printer. (Our accounts system does not give you a print option window; it automatically prints to the Default Printer). See Change Default Printer on Windows Using Defprint

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •