Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Sometimes, you need to protect all shapes in certain worksheets to prevent them from being destroyed by unwanted situations. In this case, you need to lock all shapes in the specified worksheet.
Locking shapes in a spreadsheet or document can be beneficial for several reasons:
Sometimes, you need to be able to modify certain shapes in certain protected worksheets, in which case, you need to unlock these shapes.This article will introduce in detail how to lock and unlock specified shapes.
Here’s how you can lock cells in Microsoft Excel:
Open Your Excel File: Open the Excel file that contains the shapes you want to lock.
Select the Shape: Click on the shape you want to lock. You can also select multiple shapes by holding down the Ctrl key and clicking on each shape.
Open the Format Shape Pane: Right-click on the selected shape(s) and choose “Size and Properties.” Alternatively, you can go to the “Format” tab on the Ribbon, and in the “Size” group, click on the dialog launcher (a small arrow) to open the “Format Shape” pane.
Lock the Shape: In the “Format Shape” pane, go to the “Size & Properties” tab (the icon looks like a square with arrows). Under the “Properties” section, check the box for “Locked.”

Protect the Worksheet: Go to the “Review” tab on the Ribbon. Click “Protect Sheet.” Set a password (optional) and choose the permissions you want to allow (e.g., selecting locked cells, formatting cells, etc.). Click “OK.”

To protect all shapes in a specified worksheet, use the Worksheet.Protect( ProtectionType.Objects) method, as shown in the following sample code.
To unlock a specified shape in a protected worksheet, use shape.IsLocked, as shown in the following sample code.
Note: shape.IsLocked is meaningful only when the worksheet is protected.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.