Lock shapes in excel

Anonymous
2015-08-19T04:55:56+00:00

Hi,

How could I lock all the shapes & pictures on an excel worksheet(s) so that user can't edit/delete them?

Note : Excel sheet must be unprotected in all respect so that the user can work on that sheet freely.

Many thanks

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

6 answers

Sort by: Most helpful
  1. Anonymous
    2015-08-19T14:17:49+00:00

    Hi,

    try this approach

    1st

    protect all shapes in active sht

    Sub ActiveSht_ProtectShapes()

    'Aug 19, 2015

    ActiveSheet.Unprotect Password:="1230"

    For Each s In ActiveSheet.Shapes

    s.Locked = True

    Next

    ActiveSheet.Protect Password:="1230"

    End Sub

    xxxxxxxxxxxxxxxx

    2nd

    un-protect all shapes in active sht

    Sub ActiveSht_UnProtectShapes()

    'Aug 19, 2015

    ActiveSheet.Unprotect Password:="1230"

    For Each s In ActiveSheet.Shapes

    s.Locked = False

    Next

    End Sub

    note

    if you want to protect a shape

    the active sheet must be protected.

    8 people found this answer helpful.
    0 comments No comments