View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
RodT RodT is offline
external usenet poster
 
Posts: 1
Default Custom Addin, Excel Shutdown Problem

Hi, This one is probably for a bit of an Excel guru.

I have a custom home made addin installed in Excel2000. I
have a workbook which uses functions from the Addin, the
workbook also has a combo box which calls one of these
functions on it's CHANGE event.

If I close the workbook, then close excel everything is
fine. However, if I close Excel with the workbook loaded
I get a serious error which crashes Excel and causes
problems.

When I close Excel with the workbook loaded, the Addin
WorkBook_BeforeClose event is called, then the loaded
WorkBook_BeforeClose event is called, then the combo
CHANGE event is called, in this order (for some strange
reason). When the combo CHANGE event is called it tries
to call the addin function, but of course at this stage
the addin has been closed and this causes Excel to crash
in an unseemly manner.

I notice that some other addins installed by some software
stay loaded while this is happening. Why would my Addin
be closed BEFORE the workbook is closed ? This appears to
be the cause of the problem.

Any help appreciated.

Rod.