Hi all, I have a code which works fine from other computers. But when i use it from the main computer it does not work so can you please help me in identifying which computer the code is running so that i can use that printer
if the code is run from "Desktop-165t6df" this computer i just want the printer's name
Thanks in Advance
VBA Code:
Private Sub CommandButton1_Click()
Set mynetwork = CreateObject("WScript.network")
mynetwork.setdefaultprinter "\\Desktop-165t6df\THERMAL Receipt #1"
ActiveSheet.Range("A3:B52").Select
Selection.PrintOut Copies:=1
mynetwork.setdefaultprinter "\\Desktop-165t6df\HP LaserJet 1020"
End Sub
if the code is run from "Desktop-165t6df" this computer i just want the printer's name
Thanks in Advance