Problems printing to a network printer

acollins

Board Regular
Joined
Aug 1, 2007
Messages
63
I have written a macro to print to a specific printer on the network. I started by using the macro recorder to see what Excel liked for the printer name, and then added code as necessary. It is a very simple macro that defines a print range, then prints to the specified printer as follows:

Code:
Sub PrintInvoices()

Dim strPrintArea As String

    strPrintArea = Range("rngPrint").Value
    Worksheets("Report").PageSetup.PrintArea = strPrintArea
    Worksheets("Report").PrintOut Copies:=1, Collate:=True, ActivePrinter:= _
        "Auto HP LaserJet 4000 Series PCL 6 on PAT on Ne14:", Collate:=True
    
End Sub

This macro has worked just fine for several months, but recently it started printing to my local printer (which is also set as my default printer) for no apparent reason; and I can't get it to change back to the network printer. I have verified the following:
- the network name of the device has not changed
- I still have access to it from my PC (I still see it in my Printers folder)
- The printer is physically working just fine
- I can print to it manually from my PC

I have even re-recorded the macro and the code is exactly the same as it was before (minus the code I added). Has anyone else had this problem? If so, what was your solution? Is there a better (i.e. more reliable) method of printing to a network printer (or any printer other than your default)?

Many thanks in advance for any advice or assistance anyone might be able to offer.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,214,980
Messages
6,122,563
Members
449,088
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top