LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel, VB.Net and shutdown

We are using scripts in Excel to execute code in a VB.Net object. We want
to raise events to Excel at certain times (the object will start up
separate threads for various operations).

If the main VB.Net object raises an event to Excel directly, everything is
fine. If a thread created by the main object calls the main object via
a delegate, everything is fine.

However, if the thread created by the main object calls the main object
(via a delegate) which then raises an event to Excel (chaining the two
above actions), then Excel crashes when you try to exit, even though
the thread has long since gone away and the object reference has been set
to Nothing.

The crash is occurring because code is trying to execute in a module (DLL)
that has been unloaded. By examining the module list before and after the
crash, we've determined that the module is VBE6.DLL. It looks like this
module gets unloaded, and then someone tries to execute code in it.

Has anyone seen this before? Is there anything special that needs to be
done when invoking VB.Net objects from Excel macros to allow a clean exit?

Thanks in advance...

Jay Nabonne
Sonic Solutions

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Customized buttons cause Excel shutdown in Vista? RAL/PSCN[_2_] Excel Discussion (Misc queries) 0 April 15th 09 10:11 PM
excel.exe has generated errors and will be shutdown by windows jcook Excel Discussion (Misc queries) 0 April 22nd 08 02:20 PM
excel shutdown MRR Excel Discussion (Misc queries) 0 July 20th 06 01:58 PM
Custom Addin, Excel Shutdown Problem RodT Excel Programming 4 April 15th 04 06:14 AM
Problems On Shutdown with Excel/VBA App Tim Sheppard Excel Programming 3 September 4th 03 08:19 AM


All times are GMT +1. The time now is 09:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"