Bub_the_Zombie
Board Regular
- Joined
- Nov 1, 2016
- Messages
- 53
Greetings Excel Gurus!
I have searched around most of the morning to try and solve this question before jumping to the boards.
I am trying to print sheet 2, to two different network printers. Can someone please help me with this code.
The error message is
Run-time error'1004':
Method"ActivePrinter" of object"_Application" failed
Then this gets highlighted in the VBA code
Thankful for any help
I have searched around most of the morning to try and solve this question before jumping to the boards.
I am trying to print sheet 2, to two different network printers. Can someone please help me with this code.
Code:
Private Sub CommandButton3_Click()
Application.ScreenUpdating = False
Dim WS As Worksheet
Set WS = Sheets("SHEET 2")
Application.ActivePrinter = ("[URL="file://\\BHSDC002.BHS.LOCAL\WB-MHPHP"]\\BHSDC002.BHS.LOCAL\WB-MHPHP[/URL]")
WS.PrintOut Copies:=1
Application.ActivePrinter = ("[URL="file://\\BHSDC002.BHS.LOCAL\E3-PA01-HPLJ3015"]\\BHSDC002.BHS.LOCAL\E3-PA01-HPLJ3015[/URL]")
WS.PrintOut Copies:=1
Application.ScreenUpdating = True
End Sub
The error message is
Run-time error'1004':
Method"ActivePrinter" of object"_Application" failed
Then this gets highlighted in the VBA code
Code:
Application.ActivePrinter = ("[URL="file://\\BHSDC002.BHS.LOCAL\WB-MHPHP"]\\BHSDC002.BHS.LOCAL\WB-MHPHP[/URL]
Thankful for any help