Hello,
I have been researching for about 2 weeks now and I have not been able to find a solution that I was able to make work (I'm sure it is me).
I created a simple print menu for employees to choose Printer1, Printer2, or Printer3. The rest of the code cannot proceed unless a printer has been selected.
The basic issue is that the printer port changes on these "autologin" computers that we use in the production floor. If I do NOT add the printer port in the code, it will not print.
The code works without issue EXCEPT the changing printer port
Sub PrintM1()
'
' PrintForm Macro
' Prints to Specified Printer
'Set Printer Name
Dim q As Long
Dim PrinterName As String
PrinterName = "\\pvmtowfs20\MA54_M1BOOTH on Ne12:"
Application.ActivePrinter = PrinterName
'Set Print Properties (Black & White)
Dim ws As Worksheet
Set ws = ThisWorkbook.Worksheets("Work Order #1")
With ws.PageSetup
.BlackAndWhite = True
End With
'Print Document
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Msg = "Roll Inventory Form Printed Successfully"
PrintCounter = 1
End Sub
********************************************************************************
Sub PrintM3()
'
' PrintForm Macro
' Prints to Specified Printer
'Set Printer Name
Dim q As Long
Dim PrinterName As String
PrinterName = "\\pvmtowfs20\MA47_PRODM3BOOTH on Ne07:"
' PrinterName = "Adobe PDF on Ne06:"
Application.ActivePrinter = PrinterName
'Set Print Properties (Black & White)
Dim ws As Worksheet
Set ws = ThisWorkbook.Worksheets("Work Order #1")
With ws.PageSetup
.BlackAndWhite = True
End With
'Print Document
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Msg = "Roll Inventory Form Printed Successfully"
PrintCounter = 1
End Sub
********************************************************************************
Sub PrintTL()
'
' PrintForm Macro
' Prints to Specified Printer
'Set Printer Name
Dim q As Long
Dim PrinterName As String
PrinterName = "\\pvmtowfs20\MA48_PRODOFF on Ne08:"
' PrinterName = "Adobe PDF on Ne06:"
Application.ActivePrinter = PrinterName
' PrinterName = "\\pvmtowfs20\MA54_M1BOOTH on Ne12:"
' Application.ActivePrinter = PrinterName
'Set Print Properties (Black & White)
Dim ws As Worksheet
Set ws = ThisWorkbook.Worksheets("Work Order #1")
With ws.PageSetup
.BlackAndWhite = True
End With
'Print Document
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Msg = "Roll Inventory Form Printed Successfully"
PrintCounter = 1
End Sub
I have been researching for about 2 weeks now and I have not been able to find a solution that I was able to make work (I'm sure it is me).
I created a simple print menu for employees to choose Printer1, Printer2, or Printer3. The rest of the code cannot proceed unless a printer has been selected.
The basic issue is that the printer port changes on these "autologin" computers that we use in the production floor. If I do NOT add the printer port in the code, it will not print.
The code works without issue EXCEPT the changing printer port
Sub PrintM1()
'
' PrintForm Macro
' Prints to Specified Printer
'Set Printer Name
Dim q As Long
Dim PrinterName As String
PrinterName = "\\pvmtowfs20\MA54_M1BOOTH on Ne12:"
Application.ActivePrinter = PrinterName
'Set Print Properties (Black & White)
Dim ws As Worksheet
Set ws = ThisWorkbook.Worksheets("Work Order #1")
With ws.PageSetup
.BlackAndWhite = True
End With
'Print Document
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Msg = "Roll Inventory Form Printed Successfully"
PrintCounter = 1
End Sub
********************************************************************************
Sub PrintM3()
'
' PrintForm Macro
' Prints to Specified Printer
'Set Printer Name
Dim q As Long
Dim PrinterName As String
PrinterName = "\\pvmtowfs20\MA47_PRODM3BOOTH on Ne07:"
' PrinterName = "Adobe PDF on Ne06:"
Application.ActivePrinter = PrinterName
'Set Print Properties (Black & White)
Dim ws As Worksheet
Set ws = ThisWorkbook.Worksheets("Work Order #1")
With ws.PageSetup
.BlackAndWhite = True
End With
'Print Document
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Msg = "Roll Inventory Form Printed Successfully"
PrintCounter = 1
End Sub
********************************************************************************
Sub PrintTL()
'
' PrintForm Macro
' Prints to Specified Printer
'Set Printer Name
Dim q As Long
Dim PrinterName As String
PrinterName = "\\pvmtowfs20\MA48_PRODOFF on Ne08:"
' PrinterName = "Adobe PDF on Ne06:"
Application.ActivePrinter = PrinterName
' PrinterName = "\\pvmtowfs20\MA54_M1BOOTH on Ne12:"
' Application.ActivePrinter = PrinterName
'Set Print Properties (Black & White)
Dim ws As Worksheet
Set ws = ThisWorkbook.Worksheets("Work Order #1")
With ws.PageSetup
.BlackAndWhite = True
End With
'Print Document
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Msg = "Roll Inventory Form Printed Successfully"
PrintCounter = 1
End Sub