Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If macros are disabled, then kick out the user...

  • Thread starter Thread starter j9
  • Start date Start date
Status
Not open for further replies.

j9

Programmer
Joined
Jun 6, 2001
Messages
90
Location
US
Is there a way to do this?
 
If you want to prevent the user from modifying the workbook, you can hide all but one of the sheets on closing the workbook. Then, they will have to enable macros to see the sheets. You will have to leave at least one sheet visible (maybe a blank sheet?). If you set the sheets' visibility to xlVeryHidden, they will not show up in the list for unhiding sheets. The only way they could access them would be to enable the macros.
Code:
Sub Auto_Close
    'set the sheet to xlVeryHidden
End Sub

Sub Auto_Open
    'set the sheet to xlVisible
End Sub
[code]
Hope this helps!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top