I have the following script that runs on a Click from a special Print Button.
How can I incorporate additional (or find a way around) the Application.ActivePrinter = "PrimoPDF on Ne00:" part of the code (below script, part in bold)?
Reason I am asking, It works fine for me, but errors out with someone else, and if I modify the script to "PrimoPDF on Ne01"" it works fine. First, I don't know what "Ne00 or Ne01" do or mean, but two I've seen Ne04 so I need a way to make sure the below runs for anyone.
Suggestions?
Entire Script Below
Private Sub CommandButton9_Click()
'Print button searches for only visible worksheets, doesnt ever print the Main sheet, combines all visible sheets in a print job the queues up the pdf export
Dim Response As Integer
Response = MsgBox(prompt:="Are there any outstanding items in TCB View for the Relationship/Accounts Listed Below?", Buttons:=vbYesNo)
If Response = vbYes Then
Sheets("Print").Visible = True
Sheets("Print").Range("A97") = Sheets("Print").Range("A46")
MsgBox "You have indicated that TCB View has Outstanding Items." & vbCrLf & " " & vbCrLf & "BE ADVISED - The Implementation of the Accounts below will NOT be Active until TCB View is clear."
Sheets("Print").Visible = False
End If
If Response = vbNo Then
Sheets("Print").Visible = True
Sheets("Print").Range("A97") = Sheets("Print").Range("A43")
Sheets("Print").Visible = False
End If
Application.ScreenUpdating = False
Sheets("StandardPricing").Visible = True
Sheets("ExceptionPricing").Visible = True
Sheets("StandardPricing").Range("E3") = Sheets("Print").Range("B4")
Sheets("StandardPricing").Range("K4") = Sheets("Print").Range("H2")
Sheets("StandardPricing").Range("D4") = Sheets("Print").Range("C10")
Sheets("StandardPricing").Range("D5") = Sheets("Print").Range("H10")
Sheets("StandardPricing").Range("J6") = Sheets("Print").Range("C6")
Sheets("ExceptionPricing").Range("E3") = Sheets("Print").Range("B4")
Sheets("ExceptionPricing").Range("K4") = Sheets("Print").Range("H2")
Sheets("ExceptionPricing").Range("D4") = Sheets("Print").Range("C10")
Sheets("ExceptionPricing").Range("D5") = Sheets("Print").Range("H10")
Sheets("ExceptionPricing").Range("J6") = Sheets("Print").Range("C6")
Sheets("Print").Visible = True
Dim Sh As Worksheet
Dim Arr() As String
Dim N As Integer
N = 0
Application.ActivePrinter = "PrimoPDF on Ne00:"
With ActiveWorkbook
For Each Sh In .Worksheets
If Sh.Visible = xlSheetVisible And Sh.Name <> "Main" And Sh.Name <> "Reporting" Then
N = N + 1
ReDim Preserve Arr(1 To N)
Arr(N) = Sh.Name
End If
Next
.Worksheets(Arr).PrintOut
End With
Sheets("Print").Visible = False
Sheets("StandardPricing").Visible = False
Sheets("ExceptionPricing").Visible = False
End Sub
How can I incorporate additional (or find a way around) the Application.ActivePrinter = "PrimoPDF on Ne00:" part of the code (below script, part in bold)?
Reason I am asking, It works fine for me, but errors out with someone else, and if I modify the script to "PrimoPDF on Ne01"" it works fine. First, I don't know what "Ne00 or Ne01" do or mean, but two I've seen Ne04 so I need a way to make sure the below runs for anyone.
Suggestions?
Entire Script Below
Private Sub CommandButton9_Click()
'Print button searches for only visible worksheets, doesnt ever print the Main sheet, combines all visible sheets in a print job the queues up the pdf export
Dim Response As Integer
Response = MsgBox(prompt:="Are there any outstanding items in TCB View for the Relationship/Accounts Listed Below?", Buttons:=vbYesNo)
If Response = vbYes Then
Sheets("Print").Visible = True
Sheets("Print").Range("A97") = Sheets("Print").Range("A46")
MsgBox "You have indicated that TCB View has Outstanding Items." & vbCrLf & " " & vbCrLf & "BE ADVISED - The Implementation of the Accounts below will NOT be Active until TCB View is clear."
Sheets("Print").Visible = False
End If
If Response = vbNo Then
Sheets("Print").Visible = True
Sheets("Print").Range("A97") = Sheets("Print").Range("A43")
Sheets("Print").Visible = False
End If
Application.ScreenUpdating = False
Sheets("StandardPricing").Visible = True
Sheets("ExceptionPricing").Visible = True
Sheets("StandardPricing").Range("E3") = Sheets("Print").Range("B4")
Sheets("StandardPricing").Range("K4") = Sheets("Print").Range("H2")
Sheets("StandardPricing").Range("D4") = Sheets("Print").Range("C10")
Sheets("StandardPricing").Range("D5") = Sheets("Print").Range("H10")
Sheets("StandardPricing").Range("J6") = Sheets("Print").Range("C6")
Sheets("ExceptionPricing").Range("E3") = Sheets("Print").Range("B4")
Sheets("ExceptionPricing").Range("K4") = Sheets("Print").Range("H2")
Sheets("ExceptionPricing").Range("D4") = Sheets("Print").Range("C10")
Sheets("ExceptionPricing").Range("D5") = Sheets("Print").Range("H10")
Sheets("ExceptionPricing").Range("J6") = Sheets("Print").Range("C6")
Sheets("Print").Visible = True
Dim Sh As Worksheet
Dim Arr() As String
Dim N As Integer
N = 0
Application.ActivePrinter = "PrimoPDF on Ne00:"
With ActiveWorkbook
For Each Sh In .Worksheets
If Sh.Visible = xlSheetVisible And Sh.Name <> "Main" And Sh.Name <> "Reporting" Then
N = N + 1
ReDim Preserve Arr(1 To N)
Arr(N) = Sh.Name
End If
Next
.Worksheets(Arr).PrintOut
End With
Sheets("Print").Visible = False
Sheets("StandardPricing").Visible = False
Sheets("ExceptionPricing").Visible = False
End Sub