Infomation on Printers from Excel 2000 SR-1
I am working on a spreadsheet that needs to be printed to a specific printer on our network.
This spreadsheet will be used by several different users from their own workstations.
Here is the print code so far:
Sub PrintToACCPrinter()
Dim strOldPrinter As String
strOldPrinter = Application.ActivePrinter
Application.ActivePrinter = "\\STLPS001\ACC033LJ4050 on Ne01:"
ActiveWindow.SelectedSheets.PrintOut
Application.ActivePrinter = strOldPrinter
End Sub
The problem is that the ActivePrinter object requires the Portname to be part of the string and printer port changes between workstations.
So my question is this:
How do you derive the port for a printer using VBA in Excel?