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 Resetting Excel commandbars on close event

I am automating certain aspects of Excel (and Word) using c#. I am able
to hide various commandbars and controls from the user. My problem is
that I have difficulty resetting the bars when Excel closes. I have
read some articles and threads relating to the Excel close event (or
lack of it) at the application level, but have not found any answers to
this problem.

I am using the workbook_close event to execute some code already, but I
find that when I try to reset the command bars directly from this event
handler Excel just freezes. The only way I have found so far to reset
the bars without any errors is to start a new process from this event
handler that will use a new Excel ApplicationClass and reset the bars,
before closing (without ever being visible). The problem with this is
that I have to insert a delay of around 20 seconds before starting this
new process otherwise Excel bombs out with a memeory referencing
error.

I find it hard to believe that I can remove bars and controls from my
original application, but I cannot reset them from this event handler.

Does anyone know why Excel might be freezing in this way, or how I can
reset the controls without having to use a separate process and a
delay?


---
Message posted from http://www.ExcelForum.com/

 
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
before close event with condition mohavv Excel Discussion (Misc queries) 4 November 21st 07 03:14 AM
Trapping Excel Close Event Bob J.[_2_] Excel Programming 3 December 6th 03 08:57 PM
Trapping Excel Close event Bob J[_2_] Excel Programming 3 December 5th 03 11:56 PM
Excel main window close event Avneesh Saxena Excel Programming 2 November 21st 03 07:42 PM
After Close Event? Don Wiss Excel Programming 2 November 19th 03 12:30 AM


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