Error Message When Closing a File

artvandelay

New Member
Joined
Jul 31, 2010
Messages
11
I have a spreadsheet model that I've been using that has some database queries, links to other workbooks, etc and every time I close it, I get an error message that says:

cannot find [filename] which has been assigned to run each time [MyFile] is closed. Continuing could cause errors. Cancel closing [MyFile]?

I generally continue with closing the file and then the [filename] workbook referenced in the message is opened, which I then have to close.

I inherited the model and the problem existed from the beginning, so it's not anything I did. I tried using google to find a solution and it seemed like this generally is caused by a macro. Oddly enough, there aren't any macros in my spreadsheet. Has anyone had this problem before? It hasn't caused any serious problems; it's just a nuissance having the warning and another workbook pop up every time I close my model.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Press ALT + F11 to open the Visual Basic Editor. In the VBA Project window double click ThisWorkbook. Is there any code in there?
 
Upvote 0
No, it's blank. I actually just found a site that said it might be caused by bad named ranges. I ran this macro and it seemd to fix the problem. So far I don't think it's messed anything up with the model, but I'm still checking.

<CODE>
Sub Delete_Names()
Dim Nm As Name
For Each Nm In ThisWorkbook.Names
Nm.Delete
Next Nm
End Sub
</CODE>
 
Upvote 0

Forum statistics

Threads
1,215,646
Messages
6,125,997
Members
449,279
Latest member
Faraz5023

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