Thread: Help with Code
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jim May Jim May is offline
external usenet poster
 
Posts: 430
Default Help with Code

If I open a workbook "test.xls" that has the following code in it and I make
some changes to the cells and I click on the Save (Icon) and then click on
the "x" (close file or window)
in top right corner (inside X, not Excel x) (note second block of code).

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
ActiveWorkbook.Saved = True
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayAlerts = False
ActiveWorkbook.Close
Application.DisplayAlerts = True
End Sub

When I went back an re-opened "test.xls" the changes I made were
reflected,,, grrrrrr
What am I missing here???
TIA,