Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want a message to appear on my spreadsheet (that gives directions)
if they open my file (containing a macro) and Excel does not have macros enabled. If Excel does have macros enabled I dont want to display anything. I thought something like this: "If your are seeing this message it is because your macros are disabled. To enable macros go to.....etc" Any ideas on how to determine this? Thanks. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Since you can't use a macro to determine whether macros are enabled,
one way is to 1) Create one sheet with your message (named, say, "Warning"). 2) In your ThisWorkbook code module: Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim wkSht As Worksheet For Each wkSht In Worksheets With wkSht If .Name < "Warning" Then .Visible = xlVeryHidden Else .Visible = True End If End With Next wkSht End Sub 3) Also in your ThisWorkbook code module: Private Sub Workbook_Open() dim wkSht As Worksheet For Each wkSht In Worksheets With wkSht .Visible = (.Name < "Warning") End With Next wkSht End Sub Now when the workbook is closed, the working sheets will be xlVeryHidden. Note that this won't stop someone who wants to get in without macros and has even a little knowledge of XL, but it serves as a useful warning. In article , (Excel) wrote: I want a message to appear on my spreadsheet (that gives directions) if they open my file (containing a macro) and Excel does not have macros enabled. If Excel does have macros enabled I dont want to display anything. I thought something like this: "If your are seeing this message it is because your macros are disabled. To enable macros go to.....etc" Any ideas on how to determine this? Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
ENABLE MACROS | Excel Discussion (Misc queries) | |||
Enable Macros | Excel Discussion (Misc queries) | |||
how to enable macros | Excel Discussion (Misc queries) | |||
Enable macros? | Excel Worksheet Functions | |||
Suppress the Disable Macros / Enable Macros Dialog | Excel Programming |