How Can I Find Out If An Object Is Not Closed?

will2learn

Board Regular
Joined
Dec 1, 2005
Messages
144
I'm having problems with closing Excel down. I've currently setup a number of userform and various macro's.

However when I exit the spreadsheet via a userform and then try to close Excel, I'm finding that Excel just hangs and the hourglass shows. The only way then to close Excel is via ctrl/alt/del and the task manager.

I was using ActiveWorkbook.Close but have had to use Application.Quit which will close Excel down.

However I'm not happy about this and after doing some searching on this site I believe I'm not closing down some of the objects correctly (if at all).

How can I find where I've gone wrong?

Thanks
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Set up break points (F9 key) in your code around the the form closing events..

My guess is you are hiding forms instead of unloading them, or you have certain objects in your code that are not subsequently "emptied" later

Such as Set ws1 = Sheets("Sheet1")

Set ws1 = Nothing

Just a thought, not sure if this is on track ...but worth a look anyway.
 
Upvote 0
As stated by Gibbs. Set a breakpoint. View the Call Stack when your code is in break mode to see what is running. CTRL+L or View > Call Stack
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,694
Members
448,979
Latest member
DET4492

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