APPCRASH caused by VB code when saving

jtkr996

New Member
Joined
Mar 3, 2008
Messages
10
Hello all,

I have a workbook that is intermittently crashing when saving or when trying to just close the workbook. At other times I get the crash when opening the VB editor. This workbook lives on a network share as it's used by a few people, but at different times. It will occasionally crash for one user repeatedly but another user can open it and it works fine.

I've found a temporary "fix" by opening the workbook on another computer and recompiling the VB project. For the times when it crashes while opening the editor I have to open in a older version of Excel (2007) in order to access the VB editor. I can then compile the project, save the file and then the other computer is then able to open the file and it works fine.

It seems the issue is specific to the one PC or user. All users in question here are on Excel 2016 32 bit.
I'm not a VB expert so it's probably a character in the wrong place and I don't know what i'm looking for.

A couple of my macros save a .pdf to a specific directory and add the current date to the file name. I saw another post having a similar crash while doing something similar so perhaps its related to this? (There was no replies to that post so no help there)

Any help would be appreciated.

Here is the error data:

Problem signature:
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

Additional information about the problem:
LCID: 1033
skulcid: 1033



Here is my various code (in a few different modules)

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

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:= _
        "\\networkshares\Shared\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:= _
        "\\networkshares\Shared\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:= _
        "\\networkshares\Shared\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

Please let me know if I left any info out that would be helpful. Thanks in advance.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Forum statistics

Threads
1,223,909
Messages
6,175,312
Members
452,634
Latest member
cpostell

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