Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Responding to system shutdown
Is there an event that fires in Excel when the shutdown.exe -f is used
outside Excel to reboot the system? I have an Excel application running and I would like the opportunity to save the workbook before the system shuts down. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Responding to system shutdown
Unless you have a very old version of Windows/Office/Excel it should
automatically save your work in the event of system failure. It will give you an option on restart for which file you want to save under the original file name. I always check the data in both versions before I decide, just to be sure. "sr216viper" wrote: Is there an event that fires in Excel when the shutdown.exe -f is used outside Excel to reboot the system? I have an Excel application running and I would like the opportunity to save the workbook before the system shuts down. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Responding to system shutdown
"JLGWhiz" wrote: Unless you have a very old version of Windows/Office/Excel it should automatically save your work in the event of system failure. It will give you an option on restart for which file you want to save under the original file name. I always check the data in both versions before I decide, just to be sure. "sr216viper" wrote: Is there an event that fires in Excel when the shutdown.exe -f is used outside Excel to reboot the system? I have an Excel application running and I would like the opportunity to save the workbook before the system shuts down. We are using Excel to gather data from some solar systems. So its not something that a user is working with interactive. So I was looking for an event that will fire when shutdown.exe -f is used to reboot the system. That way I can put code in the event to save the current set of data. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Responding to system shutdown
I think the only way would be to create a UserForm to load on startup and
then examine the CloseMode in QueryClose to see if the application is being shut down by Windows. Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) ' 2 = Windows is shutting down ' 3 = Task Manager is killing the process If (CloseMode = 2) Or (CloseMode = 3) Then ' your shutdown code End If End Sub Note that the UserForm need not be visible. You can just Load it without Showing it. E.g., Sub Workbook_Open() Load frmMyForm End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel, 10 Years Pearson Software Consulting www.cpearson.com (email on the web site) "sr216viper" wrote in message ... "JLGWhiz" wrote: Unless you have a very old version of Windows/Office/Excel it should automatically save your work in the event of system failure. It will give you an option on restart for which file you want to save under the original file name. I always check the data in both versions before I decide, just to be sure. "sr216viper" wrote: Is there an event that fires in Excel when the shutdown.exe -f is used outside Excel to reboot the system? I have an Excel application running and I would like the opportunity to save the workbook before the system shuts down. We are using Excel to gather data from some solar systems. So its not something that a user is working with interactive. So I was looking for an event that will fire when shutdown.exe -f is used to reboot the system. That way I can put code in the event to save the current set of data. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
excel shutdown | Excel Discussion (Misc queries) | |||
When trying to save a document the system goes Not Responding | Excel Discussion (Misc queries) | |||
UPS Shutdown script | Excel Discussion (Misc queries) | |||
Excel, VB.Net and shutdown | Excel Programming | |||
VBA to ShutDown PC | Excel Programming |