+ Reply to Thread
Results 1 to 8 of 8

print to Specific shared printer.

  1. #1
    Registered User
    Join Date
    06-09-2015
    Location
    abu dhabi,UAE
    MS-Off Ver
    2010
    Posts
    4

    print to Specific shared printer.

    Hello,

    i have an excel workbook that generate reports and make printouts to different printers depending on printer name using the code Application.ActivePrinter = thisworkbook.sheet("Main").Range("A1").value, the code worked fine when all printers are connected to the PC.

    now all printers are connected to other PCs and shared to one computer which generate the report, the problem i am facing is that the reports get printed to default printer only even the macro is set to print to a selected printer using the same code above.

    please help to solve.

    Thank you
    Redwan

  2. #2
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: print to Specific shared printer.

    Have you updated the value in Main A1 to reflect the new location of the printer?

  3. #3
    Registered User
    Join Date
    06-09-2015
    Location
    abu dhabi,UAE
    MS-Off Ver
    2010
    Posts
    4

    Re: print to Specific shared printer.

    Yes, the value get updated automatically to "PRINTER 01" or "PRINTER 03" or "PRINTER 03" then printout.
    this way was working perfectly when all printers connected to the same PC on which the reports are generated.

    Thank you

  4. #4
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: print to Specific shared printer.

    Maybe, but because the printer is no longer directly connected you will probably need the full path.
    Start the macro recorder and do a test print to get the new details of the printer.

  5. #5
    Registered User
    Join Date
    06-09-2015
    Location
    abu dhabi,UAE
    MS-Off Ver
    2010
    Posts
    4

    Re: print to Specific shared printer.

    I tried that, it's not working, i get bellow code only.

    Selection.PrintOut Copies:=1, Collate:=True, IgnorePrintAreas:=False

  6. #6
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: print to Specific shared printer.

    I was sure that worked last time I tried it.
    Try reversing the existing logic to get the correct path.
    Set the printer you want to use manually, then execute this line of code to get the correct name in A1
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    06-09-2015
    Location
    abu dhabi,UAE
    MS-Off Ver
    2010
    Posts
    4

    Re: print to Specific shared printer.

    i tried your solution it gives me the details of the printer "\\EIC1207\HP LaserJet P2050 Series PCL6 on Ne06:" but i see tehre is "Ne06". what is this and how can i get it for other printers and will it remain like this or get changed every time PC restats.

    Thank you for your help.

  8. #8
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: print to Specific shared printer.

    Ne06 is the location of the printer, it should be fixed with the network.
    I'm not entirely sure what it is based on, but I think it should only change if the printer is moved again to a different PC.

    To get the same for the other printers, set each one as active, then execute the code line as before.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Print worksheet based on cell value to specific printer
    By swiftrain in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-21-2013, 09:57 AM
  2. How to set command button to print to specific network printer
    By sspreyer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-21-2013, 12:20 AM
  3. Print to a specific Printer and also choose the pages to be printed.
    By aadeshgandhi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-20-2013, 12:07 PM
  4. VBA code to print Userform to specific Printer
    By RossN in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-08-2012, 06:03 PM
  5. Use VBA to print to a specific printer
    By rkjudy in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-25-2011, 09:38 PM
  6. Print to a specific printer
    By Rodeoclown in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-17-2010, 05:22 PM
  7. Macro to Print to specific printer
    By nsorden in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-15-2009, 12:20 PM
  8. [SOLVED] Print with paper from a specific printer-tray
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-28-2005, 08:05 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1