Solved

Excel:  VBA automatically lock down spreadsheet with exceptions

Posted on 2011-02-25
2
302 Views
Last Modified: 2012-05-11
Experts:

I am trying to not have to select every item on my spreadsheet to lockdown while ensuring that my listboxes, buttons, and pictures w/macros are clickable.  Is there away to write a VBA script that will do this?

Please see attached file NOC-Reports-r29.xlsm
0
Comment
Question by:Maliki Hassani
2 Comments
 
LVL 22

Expert Comment

by:rspahitz
Comment Utility
so you're trying to lock all the cells?  why not just set the lock property of the cells to locked (the default) and the lock property of the controls to not locked, then turn on Protection?  You can lock all cells that have their lock status enabled on demand.
0
 
LVL 41

Accepted Solution

by:
dlmille earned 500 total points
Comment Utility
Ok - I put a routine in your app to lock everything down to a constant password coded into your app - see public declarations.

I also modified your visible code to simplify it and when things aren't visible they are very hidden (meaning, the user cannot even see which sheets to unhide.

The code unlocks and relocks sheets on chart updating as the code is making a few changes based on listbox selections and updating in the datasheets.

I've done a bit of testing and looking good.

Hope this helps.

Dave
NOC-Reports-r301.xlsm
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now