Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
captcure close application event | Excel Worksheet Functions | |||
Workbook-Close StopTimer event | Excel Discussion (Misc queries) | |||
before close event with condition | Excel Discussion (Misc queries) | |||
Excel shoud not close all active books when clicking close button | Excel Discussion (Misc queries) | |||
OnTime event not firing in Workbook_Open event procedure | Excel Programming |