Sub topic 18
Protecting the Workbook Structure
This chapter assumes you can add, rename, move, and hide worksheets, and that you know how a workbook contains worksheets. It covers what workbook structure protection does, how to turn it on and off, and where it stops working.
What "structure" means
A workbook's structure is the set of its sheets: how many there are, what they are called, their order, and which are hidden. Protecting the structure locks those facts in place. It does not lock the contents of any cell.
When structure protection is on, Excel blocks these actions:
- Adding, deleting, or inserting a worksheet.
- Renaming a worksheet.
- Moving or copying a worksheet within the workbook or to another workbook.
- Hiding a worksheet, or unhiding a hidden one.
- Showing the hidden sheets list through Unhide.
- Grouping-related changes that add or remove sheets, such as creating a new sheet from a Move or Copy command.
People can still type in cells, change formulas, and format ranges. To stop that, you protect individual worksheets, which is a separate feature.
Structure protection versus sheet protection
Excel has three layers of protection that are easy to confuse. They live in different places and guard different things.
| Layer | What it guards | Where you set it |
|---|---|---|
| Workbook structure | Adding, deleting, renaming, moving, hiding, and unhiding sheets | Review tab, **Protect Workbook** |
| Worksheet protection | Cell contents and formatting on one sheet | Review tab, **Protect Sheet** |
| File encryption | Opening the file at all | File tab, Info, **Protect Workbook**, Encrypt with Password |
The name "Protect Workbook" appears in two places, which causes mistakes. On the Review tab, the Protect Workbook command protects the structure. On the File tab, the Info page has a Protect Workbook menu that contains several options, including encryption.
Turning structure protection on
- Open the workbook.
- Select the Review tab.
- In the Protect group, select Protect Workbook. On some versions the button is labeled Protect Workbook Structure.
- In the dialog box, make sure Structure is checked.
- Optionally type a password, then select OK.
- If you entered a password, Excel asks you to type it again. Retype it exactly.
The Protect group on the Review tab is where you will return to turn protection off. The button appears highlighted while protection is active.
After protection is on, right-click a sheet tab. Commands such as Insert, Delete, Rename, Move or Copy, Hide, and Unhide are grayed out. The plus button that adds a new sheet is also disabled. The keyboard shortcut Shift+F11 does nothing.
Turning structure protection off
- Select the Review tab.
- Select Protect Workbook again.
- If the workbook has a password, type it and select OK.
If there is no password, protection comes off immediately. This is why a password-free setting is only a safeguard against accidents, not against a determined user.
The Windows option
The Protect Structure and Windows dialog may show a second check box, Windows, in older versions of Excel. It fixed the size and position of the workbook window. Current versions of Excel for Microsoft 365 have removed this option from the dialog, so you will normally see only Structure. If your version still shows it, leave it unchecked unless you need to keep window sizes fixed, because it also interferes with commands such as New Window and Arrange All.
A worked scenario
Suppose you build a monthly report workbook with these sheets: Summary, Jan, Feb, Mar, and a hidden sheet named Rates that holds tax rates used by formulas on the other sheets. You send it to colleagues and want to make sure that:
- nobody deletes Rates by accident, which would turn the formulas into
#REF!errors; - nobody renames Jan, which would not break formulas but would confuse your team;
- nobody unhides Rates and edits it.
Protecting the structure covers all three points. The sheets stay in place, the names stay fixed, and Rates stays hidden because the Unhide command is disabled.
Look at how the formulas behave. This formula on the Summary sheet reads a rate from the hidden sheet:
=Rates!B2*SUM(Jan:Mar!B2)With structure protection on, Rates cannot be deleted or renamed, so the reference stays valid. The 3D reference Jan:Mar also stays stable, because nobody can drag a new sheet between Jan and Mar or move one out of that span.
That second point is useful. A 3D reference counts every sheet between its two end sheets. Without protection, a colleague could move a sheet into the span and silently change the total. Locking the order prevents that.
Notice what is still possible. A colleague can change Rates!B2 if they can reach the sheet. Hiding combined with structure protection only makes it harder to find the sheet. To prevent edits, also protect the Rates sheet itself with Protect Sheet before you hide it.
Setting a password: trade-offs
A password is optional, and the choice matters.
- No password. Anyone can turn protection off with two clicks. This guards against accidental changes by cooperative users.
- With a password. Excel asks for it every time someone turns protection off. This guards against deliberate changes by casual users.
Be aware of these facts before you rely on a password:
- Excel cannot recover a forgotten structure password. Store it in a password manager or another safe place.
- Passwords are case-sensitive.
- Structure protection passwords are a deterrent, not strong security. Third-party tools can remove them from a file, and the workbook's contents are not encrypted. If the data is confidential, use File > Info > Protect Workbook > Encrypt with Password, which encrypts the file.
Common errors and edge cases
- The sheet commands are grayed out and you do not know why. Check whether the Review tab's Protect Workbook button is highlighted. Structure protection is the most common cause.
- You cannot find the Unhide command. With structure protection on, Excel disables it. Turn protection off first.
- Macros fail. A macro that adds or deletes sheets raises a run-time error when the structure is protected. The macro must unprotect the workbook first, or the author must account for protection.
- Sheet protection is on but sheets can still be renamed. Sheet protection does not guard the structure. You need both features.
- Cells on a sheet can still be edited. Structure protection never locks cells. Use Protect Sheet for that.
- Copying cells to a new sheet is blocked. You cannot create the destination sheet. Prepare the destination sheet first, or unprotect temporarily.
- Linked workbooks. Other workbooks that link to your sheets by name still work, since the names cannot change while the workbook is protected.
- Very hidden sheets. A sheet marked as very hidden in the Visual Basic Editor does not appear in the Unhide list at all. Structure protection does not change this, and users with access to the editor can still make it visible. Do not treat it as security.
A recommended order of work
Hiding has to happen before protecting the structure, because you cannot hide a sheet afterward. That ordering is the one detail people most often get wrong.
Summary of what to remember
- Structure protection locks the sheet list, not the cells.
- It lives on the Review tab under Protect Workbook.
- A password is optional and cannot be recovered.
- Combine it with Protect Sheet for cell protection, and with file encryption for confidentiality.
Exercise
You hid a sheet named Rates, then turned on structure protection with no password. A colleague opens the file and says they cannot see Rates in the Unhide list, yet they were able to type new values into cells on the Summary sheet. Explain both observations, and name the two extra steps you would take to stop the Summary edits and to keep the file's contents private.
Show answer
The Unhide command is disabled while structure protection is on, so the hidden sheet cannot be revealed from the sheet tab menu. Structure protection does not lock cells, so the Summary sheet can still be edited. To stop the edits, use Review > Protect Sheet on Summary (and on Rates). To keep the contents private, use File > Info > Protect Workbook > Encrypt with Password. Because no structure password was set, the colleague could also just select Review > Protect Workbook to turn protection off, so a password would be needed to deter that.
Exercise
A formula reads =SUM(Jan:Mar!B2). Why does protecting the workbook structure help keep this total reliable?
Show answer
A 3D reference adds the cell on every sheet positioned between Jan and Mar. If someone can move, insert, or delete sheets, the set of sheets in that span can change and the total changes silently. Structure protection blocks those actions, so the span stays the same.