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

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
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,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

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