I want to protect my Excel workbook and the spreadsheets it contains.
The application I developed with Excel, contains menus, and buttons and graphics that change depending on the responses of a user (mcq). If I do not touch anything at the basic protection (everything is protected) and the user can only view data without interaction. If I unprotect certain cells, such as table cells, the user not only modify the data, but also objects like buttons, and that the main problem.
You must unlock your objects (adapt accordingly):
Range("K17").Select Selection.Locked = False Selection.FormulaHidden = False
This protect your sheet:
ActiveSheet.Protect DrawingObjects: = True, Contents: = True, Scenarios: = True
If you want to unprotect it:
Thanks to 0seb0 for this tip.
- Excel - A macro to protect a workbook
- Excel - A macro to create new workbook and copy data - How-To - Excel
- Excel - A macro to create new workbook and copy data ✓ - Forum - Excel
- Use a Macro to Create New Workbook and Copy Data in Excel - How-To - Excel
- Excel macro copy from one workbook to another - How-To - Excel
- Excel run macro when opening workbook - How-To - Excel