Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 300
Default After Close Event?

I have an Excel 97 spreadsheet that opens up an ActiveX server when it
starts, and closes it when it closes. It takes a couple seconds to shut
down. It would be nice to display a closing message in the StatusBar. But
if I display one on a BeforeClose event, it remains in the StatusBar after
the spreadsheet closes. When I really need is an AfterClose event that sets
it back to False, and to the default "Ready." Is there some way to achieve
this?

Thanks, Don <donwiss at panix.com.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default After Close Event?

"Don Wiss" wrote in message
...
I have an Excel 97 spreadsheet that opens up an ActiveX server when it
starts, and closes it when it closes. It takes a couple seconds to shut
down. It would be nice to display a closing message in the StatusBar. But
if I display one on a BeforeClose event, it remains in the StatusBar after
the spreadsheet closes. When I really need is an AfterClose event that

sets
it back to False, and to the default "Ready." Is there some way to achieve
this?


Hi Don,

Is the process of shutting down this ActiveX Server asynchronous? I
wouldn't think that it should be, so something like the following ought to
work:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.StatusBar = "Shutting down...."
''' Code to close the ActiveX server here.
Application.StatusBar = False
End Sub

If the process of shutting down the server really is asynchronous then
you've got a more difficult problem, because Excel itself might be closed
before the ActiveX server is finished cleaning up. In that case you'd have
to rely on a callback from the server to tell your Excel program when it's
finished closing and wait for that callback before allowing Excel to close.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 300
Default After Close Event?

On Mon, 17 Nov 2003 19:49:49 -0800, "Rob Bovey" wrote:

Is the process of shutting down this ActiveX Server asynchronous? I
wouldn't think that it should be, so something like the following ought to
work:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.StatusBar = "Shutting down...."
''' Code to close the ActiveX server here.
Application.StatusBar = False
End Sub


Thanks. That worked. What I had was the shutting down line was in an
Auto_Close event, and I had tried putting the StatusBar message in a newly
created BeforeClose. I put the two StatusBar messages surrounding the code
to close in the Auto_Close and all is fine.

Don <donwiss at panix.com.
Reply
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
captcure close application event suru Excel Worksheet Functions 2 June 17th 09 07:10 AM
Workbook-Close StopTimer event Stonewall Rubberbow Excel Discussion (Misc queries) 2 January 12th 08 11:06 PM
before close event with condition mohavv Excel Discussion (Misc queries) 4 November 21st 07 03:14 AM
Excel shoud not close all active books when clicking close button technomike Excel Discussion (Misc queries) 0 June 10th 05 05:35 PM
OnTime event not firing in Workbook_Open event procedure GingerTommy Excel Programming 0 September 24th 03 03:18 PM


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

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

About Us

"It's about Microsoft Excel"