473,385 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

using excel before windows shutdown

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
Aug 4 '06 #1
3 2271
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
Aug 4 '06 #2
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

Aug 5 '06 #3
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:
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
Aug 11 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Austin | last post by:
I wrote a program running on windows. I put the link of the program in "Start up" folder and let it executed minimized. Every time when I open the computer, my program will be running in system...
3
by: Senthil | last post by:
Hi, I would like to know the code for reboot and shutdown windows xp professional using VB.Net. thanx Senthil
6
by: carbon_dragon | last post by:
Ok, so here is the problem. I'm working on a headless server program implemented as a .NET C# Console project. There is a UPS mounted to this server (though not a windows compliant UPS). I can only...
2
by: Brian Worth | last post by:
I have just upgraded from VB 4.0 to VB .NET 2002. One program under VB 4.0 was able to shut down or restart the (windows XP) machine using a series of API calls. (Getlasterror, GetCurrentProcess,...
2
by: Phuff | last post by:
I have an application that should run in the system tray while open. It is supposed to be open at all times and I need it to dissapear when the "X" button is pushed on the form...but without...
4
by: Markus Stoeger | last post by:
Hi, I have a problem with Application.Run() when Windows is shutting down. Please have a look at the copy&paste example program below. The application has no forms. It has only got a notify...
5
by: Phil Tusa | last post by:
Greetings to all .... I have a need to issue a shutdown and/or Restart Windows XP inside my application. Any help or example code would be appreciated! -- Phil
6
sashi
by: sashi | last post by:
Shut down Windows For various reasons you may require a shut down of Windows to happen programmatically. For instance if the installation of your program requires system reconfiguration. The...
3
by: IdleBrain | last post by:
Gurus, I am trying to delay Windows Shutdown/Restart to perfrom cleanup and I am using the following code: protected override void WndProc(ref Message ex)
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.