When executing the below subroutine, excel will briefly flicker, screen turns black.
How can I stop this from happening?
Thanks!
How can I stop this from happening?
Thanks!
VBA Code:
Sub SheetAsPDF()
Application.ScreenUpdating = False
Dim ws As Worksheet
Set ws = ActiveSheet
Dim fileName As String
fileName = ThisWorkbook.Path & "\" & ws.Name & " " & Format(Date, "mm-yyyy") & ".pdf"
ws.ExportAsFixedFormat Type:=xlTypePDF, fileName:=fileName, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
MsgBox "Document saved successfully!", vbInformation
Application.ScreenUpdating = True
End Sub