View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
bbotz bbotz is offline
external usenet poster
 
Posts: 4
Default 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).