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
 

Some videos you may like

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

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
 

Watch MrExcel Video

Forum statistics

Threads
1,118,680
Messages
5,573,624
Members
412,539
Latest member
itchy00
Top