learningthings
New Member
- Joined
- Oct 29, 2021
- Messages
- 35
- Office Version
- 365
- Platform
- Windows
Hi everyone, this is the code I have so far:
The problem is that occasionally the port for the printer changes. I need to specify the ports because I have two printers connected to the same computer.
Is there a way to code the system to loop through Ne00 - Ne99 until it finds a match?
Any other methods or suggestions are appreciated!!
VBA Code:
Application.ScreenUpdating = False
Application.ActivePrinter = "RecieptPrinter on Ne00:"
Dim strCurrentPrinter As String
strCurrentPrinter = Application.ActivePrinter
With Sheets("Invoice")
.Visible = True
.PrintOut Copies:=1, Collate:=True
.Visible = False
End With
Application.ScreenUpdating = True
The problem is that occasionally the port for the printer changes. I need to specify the ports because I have two printers connected to the same computer.
Is there a way to code the system to loop through Ne00 - Ne99 until it finds a match?
Any other methods or suggestions are appreciated!!