Home All Groups Group Topic Archive Search About

using excel before windows shutdown

Author
4 Aug 2006 2:01 PM
Chris Knievel
Hi,
i am trying to save some data in a excel spreadsheet, whenever the programm
shuts down.
Mostly this happens when a user is logging off or shuts the computer down.
im am using the
Private Sub Form1_Closing(ByVal sender As Object, ByVal e As
System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
to save the data before the shutdown.
The problem is that i can't open excel. Windows is prompting that it can't
close my programm. And i am getting
some error messages like error code 800800005. Which is leading me to am MS
Website but that's not solving
my problem. Is there a chance to open excel somehow while windows is
shutting down, or do i have to save my data
in a different way?

thanks in advance
chris knievel

Author
4 Aug 2006 3:26 PM
dermot
I would save your data quickly to text, and then next time app starts
up read this into excel?
Chris Knievel wrote:
Show quoteHide quote
> Hi,
> i am trying to save some data in a excel spreadsheet, whenever the programm
> shuts down.
> Mostly this happens when a user is logging off or shuts the computer down.
> im am using the
> Private Sub Form1_Closing(ByVal sender As Object, ByVal e As
> System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
> to save the data before the shutdown.
> The problem is that i can't open excel. Windows is prompting that it can't
> close my programm. And i am getting
> some error messages like error code 800800005. Which is leading me to am MS
> Website but that's not solving
> my problem. Is there a chance to open excel somehow while windows is
> shutting down, or do i have to save my data
> in a different way?
>
> thanks in advance
> chris knievel
Author
5 Aug 2006 7:51 AM
GhostInAK
Hello dermot,

I would subclass the window procedure and trap the request to shutdown/restart
message.  Return whatever value is required to abort the shutdown.  Do your
dealio with excel, then initiate a second shutdown request prgrammatically.

-Boo

Show quoteHide quote
> I would save your data quickly to text, and then next time app starts
> up read this into excel?
> Chris Knievel wrote:
>> Hi,
>> i am trying to save some data in a excel spreadsheet, whenever the
>> programm
>> shuts down.
>> Mostly this happens when a user is logging off or shuts the computer
>> down.
>> im am using the
>> Private Sub Form1_Closing(ByVal sender As Object, ByVal e As
>> System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
>> to save the data before the shutdown.
>> The problem is that i can't open excel. Windows is prompting that it
>> can't
>> close my programm. And i am getting
>> some error messages like error code 800800005. Which is leading me to
>> am MS
>> Website but that's not solving
>> my problem. Is there a chance to open excel somehow while windows is
>> shutting down, or do i have to save my data
>> in a different way?
>> thanks in advance
>> chris knievel
Author
11 Aug 2006 9:27 AM
chris knievel
Hello,
thanks for your answers.
I am trying it with subclassing. And it's working so thanks a lot. But
is there a way to get the information wether the user is logging off or
shutting the computer down?
I know about WM_CLOSE, but i think it only tells me that the user is
shutting down, logging off or restarting. I would like to know what
exactly he is doing, so that i can continue his command after i've
saved my data in excel.

cheers
chris

GhostInAK schrieb:

Show quoteHide quote
> Hello dermot,
>
> I would subclass the window procedure and trap the request to shutdown/restart
> message.  Return whatever value is required to abort the shutdown.  Do your
> dealio with excel, then initiate a second shutdown request prgrammatically.
>
> -Boo
>
> > I would save your data quickly to text, and then next time app starts
> > up read this into excel?
> > Chris Knievel wrote:
> >> Hi,
> >> i am trying to save some data in a excel spreadsheet, whenever the
> >> programm
> >> shuts down.
> >> Mostly this happens when a user is logging off or shuts the computer
> >> down.
> >> im am using the
> >> Private Sub Form1_Closing(ByVal sender As Object, ByVal e As
> >> System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
> >> to save the data before the shutdown.
> >> The problem is that i can't open excel. Windows is prompting that it
> >> can't
> >> close my programm. And i am getting
> >> some error messages like error code 800800005. Which is leading me to
> >> am MS
> >> Website but that's not solving
> >> my problem. Is there a chance to open excel somehow while windows is
> >> shutting down, or do i have to save my data
> >> in a different way?
> >> thanks in advance
> >> chris knievel