Create a pop-up message prior to opening sheet
Further to Luke's suggestion............use this code in Thisworkbook
module.
Private Sub Workbook_Open()
Dim sht As Worksheet
For Each sht In ActiveWorkbook.Sheets
If sht.Name < "Dummy" Then
sht.Visible = True
End If
Next sht
Sheets("Dummy").Visible = False
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim sht As Worksheet
Application.ScreenUpdating = False
Sheets("Dummy").Visible = xlSheetVisible
For Each sht In ActiveWorkbook.Sheets
If sht.Name < "Dummy" Then
sht.Visible = xlSheetVeryHidden
End If
Next sht
Application.ScreenUpdating = True
ThisWorkbook.Save
End Sub
Gord Dibben MS Excel MVP
On Tue, 1 Sep 2009 10:08:01 -0700, Luke M
wrote:
As a pop-up message would require the use a macro, you can't write a macro
saying "enable macros".
Possible alternative:
Create a worksheet that is blank, except for your warning message. Then, use
the Workbook_Close event to hide all sheets except for your warning sheet.
Set the Workbook_Open event to unhide your regular sheets and hide the
warning sheet. This way, if someone opens workbook with macros enabled,
everything is fine. If macros are disabled, they only see your warning sheet.
|