Excel crashing when trying to close a workbook

G

George J

This may be a long explanation, so my apologies.

I have a HUGE workbook that has 9 userforms and alot of code in it (1MB)
Going through the forms, there is one part that crashes excel.

I enter the area-office into the form which then shows the client combobox.
Select the client and the client workbook is opened in the background - the
address combobox is then shown.
Select the address and textboxes and different details from the client's
property are shown - taking data from the client workbook.

I can cancel the address, which then just shows the client name. Cancel this
and i can select a new client - the client workbook gets closed and this
works fine.
If i try to save - the code will copy the data from the textboxes to the
client workbook and then try to save and close.

The error i get is "The object invoked has disconnected from its clients".

I have tried putting option explicit at the top of every page of code and
referenced everything.

I was using Activeworkbook.close savechanges:=true
Then tried Workbooks(x).close savechanges = true
Tried to save then close seperately, but it crashed on close.
Unloaded the userform and tried to close - still crashed.

I have no idea what could be causing this.

This project is an amalgamation of a few other workbooks that i currently
use, but have been trying to combine into one. I've stepped through the code
and it does what i expect up to this point.

If anyone could offer some advice i would be grateful.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top