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

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

XLGibbs

Well-known Member
Joined
Feb 25, 2005
Messages
2,446
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.
 
L

Legacy 98055

Guest
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
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,023
Messages
5,834,996
Members
430,331
Latest member
Syed Yasir Hannan

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
Top