Here is the code that calls the report subroutine:
If Range("Typerun") = "Standard" Then
If Range("BncSf") = "True" Then
application.ScreenUpdating = False
Call Print_BounceSafe_PDF(Range("BncSfPath"))
End If
.
.
.
Here is the report subroutine:
Sub Print_BounceSafe_PDF(RptPath As Range)
'x
Dim reportname As String
application.StatusBar = "Refreshing Bounce Safe Report"
'If file already exists, delete it.
If Dir(RptPath & ".pdf") <> "" Then
reportname = RptPath & ".pdf"
Kill reportname
End If
Sheets("bounce safe").Activate
'Execute RHXL (Control 11) Refresh (Control 1)
application.CommandBars(1).Controls(11).Controls(1).Execute
Calculate
Call Print_PDF_Rpt
application.ScreenUpdating = True
End Sub
ASKER
DoCmd.Echo False 'Updates still happen, it just doesn't show them '
DoCmd.Echo True 'Any updates previously done are now visible. '
ASKER
ASKER
ASKER
ASKER
ASKER
ASKER
ASKER
ASKER
ASKER
ASKER
Dim sht As Excel.Worksheet
Set sht = Excel.ActiveSheet
sht.Range(sht.PageSetup.PrintArea).PrintOut Copies:=1
' or...
Excel.ActiveSheet.Range(Excel.ActiveSheet.PageSetup.PrintArea).PrintOut Copies:=1
' or if you're refering to an excel object it would look something like...
objXL.ActiveSheet.Range(objXL.ActiveSheet.PageSetup.PrintArea).PrintOut Copies:=1
Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.
TRUSTED BY
Kevin