Hello,
I have a workbook used by a couple different people (but not at the same time) that is intermittently crashing while trying to save. The file is saved on a network share. Judging by the error message it's a issue with my VBA code.
I can open the file on a different computer and it works fine. The other computer having the issue will continue to crash until the file is "fixed".
My temporary fix has been to open the file on the working computer, compile the VBA project and re-saving. After these steps the file works fine on both computers and will continue to do so for days. Then seemingly at random the issue will return.
Both computers are running 32 bit Excel 2016.
The VBA in this workbook is fairly basic and is just used to automate a refresh and also saving a report as a .pdf while adding a date to the file name.
The error message and all my code is below. Any help would be appreciated.
VBA:
I have a workbook used by a couple different people (but not at the same time) that is intermittently crashing while trying to save. The file is saved on a network share. Judging by the error message it's a issue with my VBA code.
I can open the file on a different computer and it works fine. The other computer having the issue will continue to crash until the file is "fixed".
My temporary fix has been to open the file on the working computer, compile the VBA project and re-saving. After these steps the file works fine on both computers and will continue to do so for days. Then seemingly at random the issue will return.
Both computers are running 32 bit Excel 2016.
The VBA in this workbook is fairly basic and is just used to automate a refresh and also saving a report as a .pdf while adding a date to the file name.
The error message and all my code is below. Any help would be appreciated.
Code:
[B]Problem signature:[/B]
Problem Event Name: APPCRASH
Application Name: EXCEL.EXE
Application Version: 16.0.7766.2099
Application Timestamp: 595a6ab2
Fault Module Name: VBE7.DLL
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 57e4bc6a
Exception Code: c0000005
Exception Offset: 001b2512
OS Version: 6.1.7601.2.1.0.256.48
Locale ID: 1033
[B]Additional information about the problem:[/B]
LCID: 1033
skulcid: 1033
VBA:
Code:
Sub Finalize_EOM_Summary()'
' Finalize_EOM_Summary Macro
' Makes static copy of current EOM summary
'
'
'
Sheets("EOM Summary").Select
ActiveSheet.Unprotect
Sheets("EOM Summary").Copy After:=Sheets(Sheets.Count)
Range("B1:P90").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveSheet.Shapes.Range(Array("Button 1")).Select
Selection.delete
Range("B5").Select
ActiveSheet.Name = ActiveSheet.Range("AA2")
Application.CutCopyMode = False
' Delete Slicer copy
ActiveSheet.Shapes.Range(Array("Salesperson Name 1")).Select
ActiveWorkbook.SlicerCaches("Slicer_Salesperson_Name").Slicers( _
"Salesperson Name 1").delete
Columns("Q:Q").Select
Selection.delete Shift:=xlToLeft
Range("P1").Select
' Protect sheet
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub
Code:
Sub Refresh_All()'
' Refresh_All Macro
'
'
ActiveWorkbook.RefreshAll
DoEvents
MsgBox ("Data Refresh Completed")
End Sub
Code:
Sub Refresh_Daily()'
' Refresh_Daily Macro
'
'
ActiveWorkbook.RefreshAll
DoEvents
MsgBox ("Data Refresh Completed")
Sheets("Daily Dashboard").Select
End Sub
Code:
Sub SavePDF()'
' SavePDF Macro
'
'
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"\\shares01\Parts MGR\Daily Reports Archive\Parts Daily Dashboard" & " " & Format(Now, "mm-dd-yy") & ".pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
End Sub
Sub SavePDF_EOM()
'
' SavePDF Macro
'
'
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"\\shares01\End Of Month reports\EOM Report PDF Archive\EOM Report " & " " & Format(Now, "mm-dd-yy") & ".pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
End Sub
Sub SavePDF_Adj()
'
' SavePDF Macro
'
'
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"\\shares01\End Of Month reports\EOM Report PDF Archive\Adjustment Detail Report " & " " & Format(Now, "mm-dd-yy") & ".pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
End Sub