Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
John,
This should fit your need. I have several VBA applications that I not only want to protect the code, but also need to prevent the User from running a macro out of sequence (They click a button to run them). 1. First, protect all the macros with password. In the workbook load event, set a variable to a value. For example: okToRun = False 2. Then in each marco, add code to check the value of a variable. if example: If okToRun = False Then MsgBox "You are not authorized to run this macro." & vbCrLf & "Contact for additional information.", vbExclamation, "Security Warning" Exit Sub Else: End If 3. Then in the event that allows the User to run the macro (clicking the command button in my example), set the variable to True: okToRun = True Show, the macros are still visible, but can't be run unless the button is clicked. Hope that helps. Email me if you have any questions. Ed |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Hiding Columns in split view | Excel Worksheet Functions | |||
Resetting view when hiding detail in outline level | Excel Discussion (Misc queries) | |||
help... i might need a macro for this.. (hiding a specific # of ro | New Users to Excel | |||
Hiding Rows in a VBA macro | Excel Discussion (Misc queries) | |||
How do I view cell text without it visually hiding other cells? | Excel Discussion (Misc queries) |