• ActivePrinter and ‘Ne01’ designation (Excel 2002 (xp) SP2)

    Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » ActivePrinter and ‘Ne01’ designation (Excel 2002 (xp) SP2)

    Author
    Topic
    #403295

    I have a question regarding using the Application.ActivePrinter 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 Application.ActivePrinter=”printername on Ne01″. 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.

    Viewing 1 reply thread
    Author
    Replies
    • #810063

      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

      • #810917

        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 printername. When I check the Application.ActivePrinter property, it returns printername on Ne0x, where x 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!

        • #814644

          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

        • #814645

          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

      • #810918

        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 printername. When I check the Application.ActivePrinter property, it returns printername on Ne0x, where x 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!

    • #810064

      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

    Viewing 1 reply thread
    Reply To: ActivePrinter and ‘Ne01’ designation (Excel 2002 (xp) SP2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: