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: 2
Default Changing default menu item behavior

I am doing Excel Automation and I notice that when I close the Excel window
launched from my main form, EXCEL.EXE still remains in my Task Manager. I
have a cleanup routine in my main form which kills the Excel process when my
main form is closed. But, I would like the ability to detect when the user is
closing the Excel window without closing the main form and still be able to
run the cleanup function. Is there a way to detect such window closing event?

If not, I can disable the close button for the Excel window, but users would
still be able to use the FileExit menu item to close. In that case, I would
like to change the behavior of the Exit menu item so that I can run my clean
up function when FileExit is clicked. Is it possible to do so?

I am using C#, but VBA sample code would be helpful too.

Thank you so much.
 
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
Changing Default Paste behavior D Riggins Excel Discussion (Misc queries) 1 November 5th 08 07:56 PM
How to display the first Item in a combobox as the default item Nigel Excel Programming 2 December 8th 06 10:21 PM
How to display the first Item in a combobox as the default item Jim Cone Excel Programming 0 December 8th 06 06:42 PM
Strange Range.item behavior? Jeremy Gollehon[_2_] Excel Programming 5 April 16th 05 12:53 AM
Menu items added with menu item editor in older versions Michael Hoffmann Excel Discussion (Misc queries) 2 January 7th 05 01:40 PM


All times are GMT +1. The time now is 10:23 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"