PROTECTING AND HIDING

Download the associated  Workbook for this lesson

There are times when using Excel that we do not want other people to make changes to our Workbooks, Formulas, Worksheets or Cells. We can achieve this in many ways, ranging from hiding data to preventing the Workbook from opening at all without a password.

There is one very important point that we should make very clear from the start and that is that Excel was not designed for high security!. Our advice is that if you need to be totally certain that nobody can access your data then Excel is not the correct tool.  Excel is primarily a Spreadsheet application and as such offers security that will prevent most users from being able to access what you have protected.  As far a security goes in today's world it is most probably considered low level.  There are hundreds of web sites that offer password crackers for Excel Workbooks and Worksheets that will be able to gain access to loosely protected Workbooks and Worksheets.

Now, having said the above there are things we can do to make a password very hard, to impossible for a password cracker to crack. To do this we need to use a long password made up from letters (upper and lower case), numbers and symbols. When we protect a Workbook we can use up to 15 characters and when we protect a Worksheet we can supply up to 255 characters. The basics of this is, the more characters we use the harder it is to crack. The more combinations of characters we use also adds much complexity to our password.

One way we can look at this is from an old story you may have heard.  Let's say we have a chessboard and we place a one cent coin on the first square and then proceed to move the one cent coin to each square on the chessboard (64 squares in total). Each time we move it though, we double the amount, so the order would be 1, 2, 4, 8, 16, 32, 64, 128 etc. In other words after 8 moves the one cent would now be 128 cents ($1.28). This doesn't sound like much but after another 8 moves we have 32768 ($327.68). By the time we have made 64 moves the one cent is worth 9223372036854780000 (LOTS!).

It is a similar principle with our passwords.  By using a long password made up with a combination of numbers, upper and lower case letters and symbols we can increase the possible number of passwords one hell of a lot! Most password crackers use what is know as the brute force method.  This means they run through all possible combinations until they stumble on the correct one.  This can take days or months for a six character combination and may never happen for anything above this.  Many password crackers will state that they do not hold much hope for a long password, so if it is important that another user cannot access your Workbook, use a long combination. One more thing, write it down and put it somewhere safe because if you forget it, you will not be able to get in either!

Let's look at the different types of protection available to us.

Protection

Excel offers us three levels of protection from within the Workbook, these are:

  1. Protect Sheet

  2. Protect Workbook

  3. Protect and Share Workbook

The other method of Protection is protecting the Workbook from within the Save as dialog box.

Protect Sheets

By default all cells on a Worksheet are locked, but this has no effect at all unless we apply sheet protection. To lock and/or unlock cells we select the cells and go to Format>Cells-Protection.  If all the cells are locked (default) then the Locked checkbox will be checked.  If the cells are unlocked this checkbox will be unchecked.  If the selected cells are both locked and unlocked this checkbox will appear checked, but greyed out. So this means that if we apply sheet protection to a Worksheet that has not had the cells default (Locked) settings changed all cells will be locked and protected. This means we cannot make changes at to any cells on this Worksheet without first unprotecting it.

Quite often we only want a few chosen cells protected from user input. To do this, it is usually easiest to select all cells via the Select All button (the grey rectangle in the upper-left corner of a Worksheet where the row and column headings meet) or Ctrl+A and unlocking all cells and then re-locking the cells you want protected. If you unlock all cells and apply sheet protection, the user will basically only be stopped from changing any formatting and other basic functions. They will still be able to copy and paste (except Cell Comments) and type directly into the cells.

In a lot of cases it will only be the cells that contain formulas you wish to protect.  When this is the case you can do this with relative ease like this:

  1. Push Ctrl+A and then go to Format>Cells-Protection and uncheck the Locked box.

  2. Click OK.

  3. Now push F5 and click Special check the Formulas option and click OK.

  4. Now with all formula cells selected go back to Format>Cells-Protection and check the Locked box. You can also select the Hidden box, this will mean that formulas in locked cells will not be visible if the user selects the cell and looks in the Formula bar. But as with locking cells this has no effect unless the sheet is protected.

  5. Click OK.

  6. Go to Tools>Protection>Protect sheet… (Note here that you have two options checked under Allow all users of this worksheet to.....  Leave them as is).

  7. Apply a password and click OK.

  8. You will be asked to re-confirm your password.

  9. Click OK, then OK again.

Now all formula cells are protected, while non-formula cells are not. The password you can apply can consist of up to 255 characters.

Protect Workbook

This level of protection affects only the Workbook Structure and/or the current Window. By default the Structure is checked, while the Window is not.

Structure

By applying protection with the Structure checked we are preventing sheets (Worksheets and Chart) from being deleted, inserted, hidden, unhidden, moved and re-named.

Windows

By applying protection with the Windows checked we are preventing the Workbooks window from being hidden, unhidden, moved or closed.

As with sheet protection the password (optional) can be up to 255 characters in length.

Protect and Share Workbook

This method of protection applies only to a shared Workbook, so before we look at it we need to understand what a Shared Workbook is. We need to take a major detour here and look at Shared Workbooks, Track Changes, Accept or Reject changes and Merge Workbooks.

Shared Workbooks and Track Changes

A shared Workbook is a Workbook that resides on a Network and allows more than one person to make changes to it at the same time.  All users must be using Excel 97 onwards. There are some considerations that need to be made before sharing a Workbook as there are a lot of Excels features that will not work in a Shared Workbook. The list below is from the help file and should be read if considering sharing a Workbook.

Excel Help - Limitations of shared Workbooks

Some features of Microsoft Excel are not available when you use a shared workbook. If you need to use these features, do so before you share the workbook, or remove the workbook from shared use.

In a shared workbook, you cannot do the following:

End of Help

So as you can see there are few features that are not available in a Shared Workbook. When all is said and done a Shared Workbook is best suited to a Workbook that requires other users to only input data into. The main purpose of Shared Workbooks is to distribute them to different users and collect their input. The Shared Workbooks can then be Merged into one. We will look at Merged Workbooks a little later.

Track Changes

There are two menu items under Track Changes.  These are Highlight Changes and Accept or Reject Changes. The Accept or Reject Changes will only be available after Highlight Changes has been chosen and set and choosing Highlight Changes will share the Workbook.  In other words we can only Highlight Changes in a Shared Workbook.

If we go to Tools>Track Changes>Highlight Changes we will see the Highlight Changes dialog box. The first thing that we need to do is check the Track changes while editing the checkbox. This will make the When, Who, Where and Highlight changes on screen all available.  Notice that the List changes on a new sheet checkbox is not enabled. This will only be available if we have already saved the Workbook as a shared workbook.

When

This is where we can specify when Excel will display changes and has four choices

Since I Last Saved

All

Not Yet Reviewed

This option means you can highlight changes you have not yet reviewed. You review changes by selecting Accept or Reject Changes under Tools>Track Changes.

Since Date

If you select this you can type in any valid date. The default date will be the current date.

Who

There are two choices here they are :

Everyone

This is determined by the user name under Tools>Options-General/Username

Everyone but Me

Where

You can nominate a range of cells to highlighted changes on, or leave it blank and it will apply to all sheets and cells.

Highlight Changes on Screen

Selecting this option means each time a change is made to your Workbook, a cell comment will be inserted into the changed cell and will have: Username, Date, Time, Changed from and Changed to. A small comment flag (triangle) will be in the upper right of the cell and be a different colour to a normal cell comment.

Once we have selected our options we click OK, Excel will warn us that doing so will Save the Workbook and allow us to Continue or Cancel. When we opt to Continue our Workbook will become a Shared Workbook.  From now on any changes that are made will be tracked. The type of changes that are tracked are as listed below:

List changes on a New Sheet

Remembering that we must first save our Workbook as a Shared Workbook, have some changes made and those changes saved, this option provides far more information of what changes have taken place. After you have saved the Workbook as Shared and selected this option, it means that you can then go to Tools>Track Changes>Accept or Reject Changes (after changes have been made) and have the following information automatically listed on a another Worksheet named History. This sheet will also, by default, have Excels AutoFilters turned on for easier viewing.

Action number

This is the order in which the changes were made in numeric order

Date

 

Time

 

Who

User name.

Change

The type of change made eg; Cell change, row deletion etc.

Sheet

Name of the Worksheet that the change occurred on.

Range

Address of the change.

New Value

Value of the cell before it was changed.

Old Value

Value of the cell after it was changed.

Action Type

This will list whether the change was the "Result of rejected action", "Undo" or "Won" See Accept or Reject Changes below.

Losing Action

This relates to the Action Number if the change was the result of the Accept or Reject Changes dialog box. See Accept or Reject Changes below.

The History Sheet will only be available until the Workbook is re-saved. Once the Workbook is re-saved the History sheet will be deleted. To display it again simply go to Tools>Track Changes>Highlight Changes and check the Highlight changes on screen option and click OK.

Accept or Reject Changes

Once we have selected the options for Highlight Changes and there has been changes made and the Workbook has been saved, we can go to Tools>Track Changes>Accept or Reject Changes and see the Select Changes to Accept or Reject dialog box.  It is in here that we determine which changes we want to Accept or Reject. The choices here are When, Who and Where. These option are basically the same as the When, Who and Where options under the Track Changes dialog box we used earlier when we set up Track Changes. To Accept or Reject Changes for the entire Workbook, leave the Where checkbox unchecked.

Once we have made our choices we click OK and Excel will display the Accept or Reject Changes dialog box. We can now move through all the changes made and either Accept or Reject them. Rejecting a change will result in the cell being returned to its changed from value. If there has been more than one change to a cell and the Workbook has been saved between changes, you will see a list of the changes made. You simply select the value you wish to return the cell value back to and click Accept.  The Accept All and Reject All buttons will either reject or accept all changes, depending on the choice made. You must either Accept or Reject a change before you can move onto the next change.

Ok, now we have worked our way through Highlight Changes and Accept or Reject Changes we can move onto Sharing a Workbook.

Share a Workbook

Once you have decided to share a Workbook (based on the limitations listed earlier) you go to Tools>Share Workbook…  This will display the Share Workbook dialog box. There are two page tabs on this dialog box, Editing and Advanced.  To share the Workbook we must first check the Allow changes by more than one user at the same time checkbox.  The Who has the workbook open now shows the names of all users who currently have the Workbook open and the date and time they opened it. You can select a name from here and click the Remove User button. Just be aware that if you remove a user before he/she has saved changes those changes will be lost.

One common problem that can happen with Shared Workbooks is that they are Shared before all the necessary steps have been taken. This is particularly true should you decide to Password Protect the Shared Workbook after it has already be Shared. So before sharing a Workbook it pays to ensure you have thought through all settings that will be needed. To Password Protect a Shared Workbook you need to remove the Workbook from Shared use, which can cause unforeseen problems.

It is also possible to Merge changes from a Workbook that is Shared, but there are certain conditions that must be met for this to be possible.  The list below is from the Microsoft Excel help

Excel Help

End of Help

We will look at this after going through the rest of Shared Workbooks. The text below is a brief explanation of the features on the Advanced page tab of the Share Workbook dialog box

Advanced

Once we have checked the Allow changes by more than one user at the same time checkbox we can set up the options under the Advanced page tab.

Track Changes

Keep change history for ........ days

In the box to the right of this simply enter the number of days you want the changed history retained for.

Don't keep change history

Switches off the change history. This means you cannot Merge changes from other copies of the same Workbook or review any changes.

Update Changes

When file is saved

All changes made by yourself, or by other users are updated each time you save the Workbook.

Automatically every ..... minutes

Will automatically show you changes that have been made and saved by other users at the interval you specify in the minutes box.

Save my changes and see others' changes

Works in conjunction with Automatically every ….minutes. Your changes are saved, while changes from other users are updated at the interval you set in the Automatically every ….minutes box

Just see other users' changes

Works in conjunction with Automatically every ….minutes. All others' changes are updated at the time interval specified in the Automatically every ….minutes, but your changes are not saved at the time of update.

Conflicting changes between users

Ask me which changes win

If checked and conflicting changes occur you will be displayed the Resolve Conflicts dialog box. In here you can review the conflicting change and decide which change wins.

The change being saved wins

If checked, any conflicting changes will be automatically replaced with your changes each time you save. The Resolve Conflicts dialog box will not appear.

Include in personal view

Print Settings

Will save all your personal print settings, if you have specified any.  Print settings include page breaks, print areas, any settings you make in page break preview, and any settings in the Page Setup dialog box (File menu).

Filter settings

Retains any settings you make using the Auto filter or Advanced filter

Merge Workbooks

Preparing a Workbook for Merging

As mentioned above it is possible to Merge multiple copies of the same Workbook if it is Shared. But before this is possible we must have specified a number of days in the Keep change history for…..days option on the Advanced page tab of the Share Workbook dialog box. This means that if we created our Shared Workbook on the 1-Jan-2005 and had set the Keep change history for…..days to 15 days, we MUST perform the Merge before the 16-Jan-2005 (15 days from 1-Jan-2005). After this date it is no longer possible to Merge the Workbooks. If you are unsure how long it will be before you Merge the copies, then simply enter a large number of days. The Maximum allowed days are 32,500.

In a nutshell, the procedure for preparing a Shared Workbook for Merging would be:

  1. Go to Tools>Share Workbook and ensure the Allow changes by more than one user at the same time checkbox is checked.

  2. Select the Advanced page tab

  3. Check the Keep change history for checkbox and type in any number of days.  Remember though that if the number of days you specify expires you will not be able to perform a Merge.

  4. Click OK and save.

  5. To allow distribution of the Workbook to multiple users go to File>Save as and save multiple copies of the Workbook, each with a different name.

Merging the Workbooks

Once the Workbook has been shared for the required time (before Keep change history for… days expires) we can Merge all copies of the Shared Workbook. This is a very straightforward process, all we need to do is ensure all copies we want to Merge are closed. The only copy open should be the Workbook we are going to perform the Merge in.

  1. Go to Tools>Merge Workbooks. If prompted to save, do so.

  2. Select the Workbook(s) to Merge from the Select Files to Merge Into the Current Workbook dialog box. For more than one copy hold down the Ctrl or Shift key while selecting. Do not include the current Workbook!

  3. Click OK.

    Excel Help

If a cell contains a comment, the comment includes the name of the person who inserted the comment. When you merge shared workbooks and a cell has comments from more than one person, the comments appear one after another in the comment box for the cell.

End of Help

All copies of the Shared Workbook will now be Merged into one. If you wish you can now go to Tools>Track Changes>Accept or Reject Changes and use the Accept or Reject Changes dialog to overwrite, accept or reject any changes.

Removing a Workbook from Shared Use

When we remove a Workbook from shared use you will be disconnecting all other users of the Shared Workbook and they will lose any unsaved Work.  It also means we will be switching off the Change History and erasing any stored history.  To top this off it also means the Workbook cannot be Merged with other copies of the Workbook. For these reasons you should be certain that all needed work is completed, then inform all other users of the Shared Workbook of your intentions so they do not lose any unsaved Work.

Ideally the Workbook should only be removed from Shared use when all work has been competed. The Steps for removing a Workbook from Shared use are as below:

  1. Go to Tools>Shared Workbook and select the Editing tab.

  2. Look in the Who has this workbook open now box. If others do have the Workbook open they will lose unsaved work.

  3. Uncheck the Allow changes by more than one user at the same time checkbox.

  4. Click OK

  5. Excel will prompt you about the effects this will have on other users.

  6. Click Yes.

Now we have covered Sharing Workbooks and Merging Workbooks etc, we can divert back to where we left of ie; Protecting Shared Workbooks

Protect Shared Workbook

When we apply protection to a shared Workbook we are doing so so other users of the Shared Workbook cannot intentionally or accidentally remove Track Changes, Unshare the Workbook or change the Keep change history for…..days option on the Advanced page tab of the Share Workbook dialog box. If no password is provided any user can increase the number of days the History will be retained for but not reduce the number.

As strange as it sounds, we cannot apply a Password to a Shared Workbook, we must first remove the Workbook from Shared Use (see Removing a Workbook from Shared Use above), which can cause problems as stated above. Ideally, we should decide whether we will want to password protect a Shared Workbook before we distribute it for sharing. We can however apply protection to a Shared Workbook if no password is required. The steps for protecting a Shared Workbook are:

  1. If the Workbook is not yet a Shared Workbook go to Tools>Share Workbook and select the Editing page tab. Check the Allow changes by more than one user at the same time checkbox and then select the Advanced page tab. Ensure that the Keep change history for option is selected and you have specified a number of days, remembering that if the number of days you specify expires you will not be able to perform a Merge. Go back to the Editing page tab and uncheck the Allow changes by more than one user at the same time checkbox, then click OK.

  2. If the workbook is already Shared, go to Tools>Share Workbook and select the Advanced tab. Ensure that the Keep change history for option is selected and you have specified a number of days, remembering that if the number of days you specify expires you will not be able to perform a Merge.

  3. Click OK

  4. Go to Tools>Protection>Protect Shared Workbook or Protect and Share Workbook if not yet Shared.

  5. Check the Sharing with track changes checkbox.

  6. If the Workbook is not currently shared you will be able to type in a password. If this option is not enabled and you want to apply a password, you will need to remove the Workbook from Shared use!

  7. Click OK and say Yes if prompted to save.

    Excel Help

Note: When you again want to allow changes without tracking them, point to Protection on the Tools menu, and then click Unprotect Shared Workbook. If prompted, enter the password. When you remove password protection from the sharing, you also remove the workbook from shared use.

    End of Help

Protecting  the Workbook from within the Save as dialog Box

The last method of Protection is accessed via File>Save as options. It is from within here we can set the File sharing options.

Password to Open

This is where we can type a password of up to 15 characters which will prevent another user from being able to open the Workbook, unless they have the password.

Password to modify

By applying a password in this box we are preventing other users from making any changes to our Workbook. Another user will be able to open the Workbook and make changes, but they will not be able to save the Workbook with the same name

Read-only recommended

Checking this checkbox will mean the user will be asked to open the Workbook as read-only, unless they need to make changes to it. They will have three choices Yes, No and Cancel. If they select Yes (default) they will not be able to save the Workbook with the same name. If they select No the Workbook will open as normal and they will be able to save the Workbook as normal. Selecting Cancel will stop the Workbook from opening.

 

Microsoft ® and Microsoft Excel ® are registered trademarks of Microsoft Corporation. OzGrid.com is in no way associated with Microsoft.

OzGrid.com accepts no responsibility for any adverse affect that may result from undertaking our training.