Solved

Excel:  VBA automatically lock down spreadsheet with exceptions

Posted on 2011-02-25
2
307 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 42

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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa‚Ķ

635 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