Not Printing all pages
Posted: Wed Aug 11, 2010 6:17 pm
I am new to Bullzip. I have written a script to print a file through Bullzip, and it seems to run fine, except that when I look at the PDF file I created only a protion of the pages are there (56 of 83). I have increased the Ghostscripttimeout to 600 9from default of 300, but has not made any difference. Any suggestions on what to try next?
I have tried to post this before, but since I cant find my post (it doesn't show up) I am trying to post this again.
MYCODE:
Private Sub PDFBullzip()
Dim Bullzip As New Bullzip.PDFPrinterSettings
Dim PSFileName As String
Dim PDFFileName As String
Dim PDFlog As String
Dim ShellStr As String
Dim lastRow As Long
Dim PDFOk As Boolean
On Error GoTo Print_Error
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.Calculation = xlCalculationManual
Application.CalculateBeforeSave = False
g_RecordDate2 = Format(g_RecordDate, "yyyy.mm")
g_ReportNP = g_ReportStorePath & g_BankInfo.file_path & "\reports\" & g_RecordDate2 & "_" & g_BankID & "_" & g_BankInfo.short_name
PSFileName = g_ReportNP & ".ps"
PDFFileName = g_ReportNP & ".pdf"
PDFlog = g_ReportNP & ".log"
If InStr(ActivePrinter, "Bullzip") = 0 Then
Dim StorePrinter$, PrinterChanged As Boolean
PrinterChanged = True
StorePrinter = ActivePrinter
ActivePrinter = GetFullNetworkPrintername("Bullzip")
End If
Call Bullzip.SetValue("Output", PDFFileName)
Call Bullzip.SetValue("ShowSettings", "never")
Call Bullzip.SetValue("ConfirmOverwrite", "no")
Call Bullzip.SetValue("ShowSaveAs", "never")
Call Bullzip.SetValue("Showpdf", "no")
Call Bullzip.SetValue("SuppressErrors", "yes")
Call Bullzip.SetValue("GhostscriptTimeout", "600")
Bullzip.WriteSettings (True) 'writes the settings in a runonce.ini that is immediately deleted after use.
g_AMGRWTemplate.Activate
g_AMGRWTemplate.Worksheets("control").Columns("A:EZ").AutoFit
g_AMGRWTemplate.Worksheets("branch").Columns("A:EZ").AutoFit
g_AMGRWTemplate.Worksheets("hist_data").Columns("A:EZ").AutoFit
On Error GoTo 0
On Error GoTo Print3_Error
g_AMGRWTemplate.Worksheets(g_ReportArray).Select
On Error GoTo 0
On Error GoTo Print_Error
g_AMGRWTemplate.Worksheets(g_ReportArray).PrintOut
PDFOk = True
Exit Sub
Print3_Error:
MsgBox Title:="Caution!", Prompt:="AMGRW can't print the report due to missing sheets in Master_ALCO." & vbCrLf & " Please verify every sheet in this bank's Report Profile exists in Master_ALCO." & vbCrLf & vbCrLf & "Err.Number: " & Err.Number & vbCrLf & "Err.Source: " & Err.Source & vbCrLf & "Err.Description: " & Err.description & vbCrLf & vbCrLf & "Please check error log for details.", Buttons:=vbCritical
Application.DisplayAlerts = True
PDFOk = False
Exit Sub
Print_Error:
MsgBox Title:="Caution!", Prompt:="AMGRW can't print the report through Bullzip. " & vbCrLf & vbCrLf & "Err.Number: " & Err.Number & vbCrLf & "Err.Source: " & Err.Source & vbCrLf & "Err.Description: " & Err.description, Buttons:=vbCritical
PDFOk = False
End Sub
I have tried to post this before, but since I cant find my post (it doesn't show up) I am trying to post this again.
MYCODE:
Private Sub PDFBullzip()
Dim Bullzip As New Bullzip.PDFPrinterSettings
Dim PSFileName As String
Dim PDFFileName As String
Dim PDFlog As String
Dim ShellStr As String
Dim lastRow As Long
Dim PDFOk As Boolean
On Error GoTo Print_Error
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.Calculation = xlCalculationManual
Application.CalculateBeforeSave = False
g_RecordDate2 = Format(g_RecordDate, "yyyy.mm")
g_ReportNP = g_ReportStorePath & g_BankInfo.file_path & "\reports\" & g_RecordDate2 & "_" & g_BankID & "_" & g_BankInfo.short_name
PSFileName = g_ReportNP & ".ps"
PDFFileName = g_ReportNP & ".pdf"
PDFlog = g_ReportNP & ".log"
If InStr(ActivePrinter, "Bullzip") = 0 Then
Dim StorePrinter$, PrinterChanged As Boolean
PrinterChanged = True
StorePrinter = ActivePrinter
ActivePrinter = GetFullNetworkPrintername("Bullzip")
End If
Call Bullzip.SetValue("Output", PDFFileName)
Call Bullzip.SetValue("ShowSettings", "never")
Call Bullzip.SetValue("ConfirmOverwrite", "no")
Call Bullzip.SetValue("ShowSaveAs", "never")
Call Bullzip.SetValue("Showpdf", "no")
Call Bullzip.SetValue("SuppressErrors", "yes")
Call Bullzip.SetValue("GhostscriptTimeout", "600")
Bullzip.WriteSettings (True) 'writes the settings in a runonce.ini that is immediately deleted after use.
g_AMGRWTemplate.Activate
g_AMGRWTemplate.Worksheets("control").Columns("A:EZ").AutoFit
g_AMGRWTemplate.Worksheets("branch").Columns("A:EZ").AutoFit
g_AMGRWTemplate.Worksheets("hist_data").Columns("A:EZ").AutoFit
On Error GoTo 0
On Error GoTo Print3_Error
g_AMGRWTemplate.Worksheets(g_ReportArray).Select
On Error GoTo 0
On Error GoTo Print_Error
g_AMGRWTemplate.Worksheets(g_ReportArray).PrintOut
PDFOk = True
Exit Sub
Print3_Error:
MsgBox Title:="Caution!", Prompt:="AMGRW can't print the report due to missing sheets in Master_ALCO." & vbCrLf & " Please verify every sheet in this bank's Report Profile exists in Master_ALCO." & vbCrLf & vbCrLf & "Err.Number: " & Err.Number & vbCrLf & "Err.Source: " & Err.Source & vbCrLf & "Err.Description: " & Err.description & vbCrLf & vbCrLf & "Please check error log for details.", Buttons:=vbCritical
Application.DisplayAlerts = True
PDFOk = False
Exit Sub
Print_Error:
MsgBox Title:="Caution!", Prompt:="AMGRW can't print the report through Bullzip. " & vbCrLf & vbCrLf & "Err.Number: " & Err.Number & vbCrLf & "Err.Source: " & Err.Source & vbCrLf & "Err.Description: " & Err.description, Buttons:=vbCritical
PDFOk = False
End Sub