Home |
Search |
Today's Posts |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Samuel,
I usually will create a "Welcome Message" sheet that says something like "Please enable macros to continue," usually with brief instructions in case they don't know how. That way when they open the workbook if they see the Welcome Message sheet they don't have macros enabled and need to enable them to make the other sheets visible. Then the code looks like this: Private Sub Workbook_Open() 'Hides the Welcome Message Sheet and displays other sheets Worksheets("Sheet1").Visible = True Worksheets("Sheet2").Visible = True Worksheets("Welcome Message").Visible = xlVeryHidden End Sub Private Sub Workbook_BeforeClose(Cancel As Boolean) Worksheets("Welcome Message").Visible = True Worksheets("Sheet1").Visible = xlVeryHidden Worksheets("Sheet2").Visible = xlVeryHidden End Sub You want to be sure that you order the show/hide procedures as shown above, you'll get an error if, in the BeforeClose event, you hide Sheet1 and Sheet2 before showing Welcome Message. Good luck! -Hannah "Samuel Looney" wrote: How can it be determined whether or not a user enabled macros? The workbook I created has a lot of code that validates data input and I do not want anyone to change the information unless the macros are enabled. Any ideas? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How To Check If The User Has Macros Enabled When The Workbook Opens | Excel Programming | |||
choose default macros Not Enabled / Macros Enable Setting | Excel Programming | |||
Enabled macros | Excel Programming | |||
Open workbook-macros enabled, opening another with macros | Excel Programming | |||
How to have macros enabled at start | Excel Programming |