Solved

Excel:  VBA automatically lock down spreadsheet with exceptions

Posted on 2011-02-25
2
303 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
ID: 34980819
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
ID: 34982859
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

920 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

17 Experts available now in Live!

Get 1:1 Help Now