View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Simon Lloyd[_603_] Simon Lloyd[_603_] is offline
external usenet poster
 
Posts: 1
Default Forcing worksheets to be closed first when user trying to close excel


Hi, stick this in the this workbook module, no matter how you try t
close the workbook it will save it first (as long as you hav
previously saved it i.e not the generic Book1.xls that is generate
when you first open a new workbook) and then allow it to close.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveWorkbook.Save
End Sub

HTH

Simo

--
Simon Lloy
-----------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...nfo&userid=670
View this thread: http://www.excelforum.com/showthread.php?threadid=27571