D
Dave Unger
Hello,
I’ve searched the groups, but can’t seem to find anything that quite
addresses this, hoping someone can tell me where I’m going wrong.
I have the following code in the BeforeClose event :
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim wk As Worksheet
For Each wk In ThisWorkbook.Worksheets
wk.Visible = xlSheetVisible
Next wk
End Sub
When I close the workbook manually, it works as expected. But if I
run
“ThisWorkbook.Close savechanges:=False” from a procedure, it doesn’t.
I can step thru the code manually, but nothing happens. I’m getting
the same results with XL97 & 2007, so obviously I’m missing something
basic here. Any help would be very much appreciated.
regards
Dave U
I’ve searched the groups, but can’t seem to find anything that quite
addresses this, hoping someone can tell me where I’m going wrong.
I have the following code in the BeforeClose event :
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim wk As Worksheet
For Each wk In ThisWorkbook.Worksheets
wk.Visible = xlSheetVisible
Next wk
End Sub
When I close the workbook manually, it works as expected. But if I
run
“ThisWorkbook.Close savechanges:=False” from a procedure, it doesn’t.
I can step thru the code manually, but nothing happens. I’m getting
the same results with XL97 & 2007, so obviously I’m missing something
basic here. Any help would be very much appreciated.
regards
Dave U