VBA Wb.Save causes Excel to Crash

jscranton

Well-known Member
Joined
May 30, 2011
Messages
707
I have some code that performs a number of operations on some excels, saves them and moves them to a new folder. I have some currently that are crashing Excel on the Workbook.Save command. I turned on Alerts and created an error trap but Excel just crashes. How can I figure out what is going on?

Code:
     If processed = True And e = 0 Then        Application.DisplayAlerts = False
        Wb.RemovePersonalInformation = True 'double clean
        fileName = Wb.Name
        On Error Resume Next
        Err.Clear
[B]        Wb.Save 'save it[/B]
        e = Err.Number
        If e <> 0 Then GoTo saveFile
        On Error GoTo saveFile
        Wb.Close 'close it
        Call moveCurrentFile(fileName, inProcessingPath, processedPath) 'move it
        Application.DisplayAlerts = True
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
I may have isolated the error. When I manually open these, there is a circular reference alert (alerts are turned off for the process). Once I fixed the circular reference error, the problem went away. Is there a programmatic way to ignore this error?
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,733
Members
448,987
Latest member
marion_davis

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