VBA Print Network Printer

Lukums

Board Regular
Joined
Nov 23, 2015
Messages
195
G'day guys,

On the last major issue of my automation project and it's a monster.

We have 15 network label printers in the factory running off 1 PC in the office, there is 1 work book MASTER.xlsm with 15 sheets, 1 for each machine.

I need to identify a cell in A1 for example when it gets flagged with "1" then print, print selection to a specific network printer.

I'm able to print the selection with the default printer or active printer but I can't seem to find anything useless stating that \\luke\\192.168.2.XXX PRINT \\luke\192.168.2.XXX etc

Can this be achieved?


2 lots of code which I've tried and BOTH work, apart form the ability to assign a specific network printer, I've tried name+IP address no good I'm afraid.

-------------------------------------


Sub PrintToNetwork2()


If Range("A1").Value = "YES" Then


ActiveSheet.PrintOut ActivePrinter:=”DocuCentre - IVC2263”

-------------------------------------

If Range("F6").Value = "YES" Then






Range("B3,C3,D3,E3,F3,F11,D14").Select
Range("D14").Activate
ActiveSheet.PageSetup.PrintArea = "$B$3:$F$3,$F$11,$D$14"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False

end if

----------------------------------------



As always your help is always appreciated.

Luke
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

Forum statistics

Threads
1,216,110
Messages
6,128,892
Members
449,477
Latest member
panjongshing

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