?
Solved

Check if sheet is protected and cell is locked

Posted on 2012-04-12
2
Medium Priority
?
635 Views
Last Modified: 2012-06-21
Hi,

I know you can directly lock a cell/protect a sheet.

But is there anyway to check if a sheet is protected via VBA? if then (yes) a specific cell is locked?

Searches returned nothing relevant. Any help is appreciated!

Thanks!
0
Comment
Question by:Shanan212
[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 93

Accepted Solution

by:
Patrick Matthews earned 2000 total points
ID: 37839939
Yes.  Something like this:

With ActiveSheet
    If .ProtectionMode Then
        If .[a1].Locked Then 
            MsgBox "Cell locked"
        Else
            MsgBox "Cell unlocked"
        End If
    Else
        MsgBox "Worksheet unprotected"
    End If
End With

Open in new window

0
 
LVL 13

Author Closing Comment

by:Shanan212
ID: 37840012
Perfect! Thanks!
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

752 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