ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Forced reboots -- Making Excel save always before file close (https://www.excelbanter.com/excel-discussion-misc-queries/146206-forced-reboots-making-excel-save-always-before-file-close.html)

bbotz

Forced reboots -- Making Excel save always before file close
 
Our IT department installs updates after hours. Many times, these updates
force a machine reboot. I have long jobs that I run overnight using VBA to
send ODBC update queries from Excel to our server. Forcing a reboot loses all
the audit trails I compile while sending the update queries.

Is there a way to force Excel to save a spreadsheet when it gets a forced
reboot message from the network?? Autosave doesn't work because it appears
the machine has to be idle for the autosave to work (plus I lose any data
that I uploaded between autosaves).

rdwj

Forced reboots -- Making Excel save always before file close
 
difficult one, as the reboot may reside outside excel and not be caught.
However, try either to write a SaveAs in the "ThisWorkbook" object, and
select "BeforeClose" (<Alt+<F11, select ThisWorkbook in the Project Window,
Select "Workbook" in the left dropdown and BeforeClose in the right one.

Alternative is to save after x minutes or save at the end of completion of a
piece of code

"bbotz" wrote:

Our IT department installs updates after hours. Many times, these updates
force a machine reboot. I have long jobs that I run overnight using VBA to
send ODBC update queries from Excel to our server. Forcing a reboot loses all
the audit trails I compile while sending the update queries.

Is there a way to force Excel to save a spreadsheet when it gets a forced
reboot message from the network?? Autosave doesn't work because it appears
the machine has to be idle for the autosave to work (plus I lose any data
that I uploaded between autosaves).


bbotz

Forced reboots -- Making Excel save always before file close
 
good idea. forgot about the 'on close' routines. ill implement...

"rdwj" wrote:

difficult one, as the reboot may reside outside excel and not be caught.
However, try either to write a SaveAs in the "ThisWorkbook" object, and
select "BeforeClose" (<Alt+<F11, select ThisWorkbook in the Project Window,
Select "Workbook" in the left dropdown and BeforeClose in the right one.

Alternative is to save after x minutes or save at the end of completion of a
piece of code

"bbotz" wrote:

Our IT department installs updates after hours. Many times, these updates
force a machine reboot. I have long jobs that I run overnight using VBA to
send ODBC update queries from Excel to our server. Forcing a reboot loses all
the audit trails I compile while sending the update queries.

Is there a way to force Excel to save a spreadsheet when it gets a forced
reboot message from the network?? Autosave doesn't work because it appears
the machine has to be idle for the autosave to work (plus I lose any data
that I uploaded between autosaves).



All times are GMT +1. The time now is 05:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com