Workbook to PrimoPdf

smhutch

New Member
Joined
Aug 13, 2009
Messages
18
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
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top