Problem with ThisWorkBook.Saved

P

PGC

Hi
i have the following code on a worksheet:

Sub Worksheet_Activate()
Dim OldSaved As Boolean
OldSaved = ThisWorkbook.Saved

rem code here to fill a listbox

ThisWorkbook.Saved = OldSaved
End Sub

Which should stop the workbook requiring a save each time the worksheet is
activated, but it doesn't seem to work.

If i save the workbook, deactivate & reactivate the worksheet then try &
close the workbook i get asked if i want to save my changes.

If i check the value of ThisWorkbook.Saved before closing it shows as
True.

Excel 2000
There is no other code in the workbook.
i have no other workbooks open, (i do have ATPVBAEN.XLA & FUNCRES.XLA
loaded).

If i disable the code to fill the listbox the sub works as expected

Any ideas what could be the problem?
 
Top