Cannot Edit a Macro on a Hidden Workbook – How to Fix This Error?

Are you facing the ‘cannot edit a macro on a hidden workbook’ error on MS Excel? Fear not! We have got solutions for you.

Many Microsoft Excel users use macros for faster task completion. It is a great way to make sure you are saving time while working with complex Excel files. You can add or remove macros on MS Excel whenever you want to.

In addition, you can also edit a macro if you want to. However, many people have complained that they are facing an error while trying to edit macros on MS Excel. If you are also one of them who is facing the ‘Cannot edit a macro on a hidden workbook’ error.

Then you have come to the right place. Because we will be sharing all the processes of solving this error in this post. So keep reading the rest of the post.

Cannot edit a macro on a hidden workbook – What Does it Mean?

First of all, we will explain what is does it mean by the ‘cannot edit a macro on a hidden workbook’ error. As the error command says, you cannot edit a macro that is hidden.

Cannot Edit a Macro on a Hidden Workbook

So, if you have any hidden macro that you want to edit, you see this error.

What is the reason behind – cannot edit a macro on a hidden workbook?

You have seen the ‘cannot edit a macro on a hidden workbook’ appearing on the screen. But what does it mean actually? To be frank, this is a well-known error to avid MS Excel users.

However, most new users that tend to start using macros might be confused by this. Normally, you can create macros in MS Excel for your convenience. Later, you can also edit them to your liking.

But, if any macros are hidden, then you cannot actually edit that particular macro. Because MS Excel wouldn’t be able to find that macro. So you are seeing the ‘cannot edit a macro on a hidden workbook’ because that particular workbook is hidden.

Lucky for you, this is a problem that can be solved very easily. And we are going to share the methods in the next section for you.

Methods of fixing – cannot edit a macro on a hidden workbook

There are many easy ways you can fix the cannot edit a macro on a hidden workbook. At this point, we will be sharing all the different methods on how to fix cannot edit a macro on a hidden workbook.

Remember, we will be sharing a number of ways to fix the error. That means you need to try all the methods and see which one fixes your problem. So let’s go…

Method #1 Try Unhiding the Hidden Workbook

There are many fixes to this particular problem. However, in this part of the post, we will try to share the method that is the most effective. For your information, you cannot edit or delete macros from the Excel view in the hidden Workbook.

So first of all, you will need to unhide the workbook. In doing so, the ‘cannot edit a macro on a hidden workbook’ error will never appear again. So here’s how to unhide a Workbook.

Steps to Follow

  • First of all, you will need to navigate to the Excel Ribbon
  • Then you need to click on the View tab from the menu bar
  • After that, you will need to click on the Widows Group option
  • From there, you need to click on the Unhide option
  • In doing so, you will see a new window was opened with all the list of the hidden workbooks
  • Now, you have to select the particular workbooks you want to unhide and then click on the Unhide option

If you have not set up any passwords on your Excel Workbook, then the workbooks will be unhidden immediately. However, if there is a password, then you will need to enter the password to save the changes.

And you will see that the ‘cannot edit a macro on a hidden workbook – how to fix this error’ will not appear anymore once you have unhidden the workbook.

Method #2 Try Unhidhing the PERSONAL.Xlsb File

If you have tried the previous method and still facing the error, then you can try this one. There is a workbook named ‘PERSONAL.Xlsb’ on Excel. However, this file remains hidden by default. So it is possible that the macro you are trying to edit or delete is hidden on this file.

So at first, you will have to unhide the ‘PERSONAL.Xlsb’ file. Because this workbook usually becomes hidden when you open a normal workbook. So how do you do that? It is very simple. Let’s learn that below.

Steps to Follow

  • First of all, you have to navigate to this folder on your PC, C:\Users\UserName\AppData\Roaming\Microsoft\Excel\PERSONAL
  • Now you have to right click on the ‘Personal’ folder and click on the Properties option from the overlay menu
  • At this point, you will see that the ‘Hidden’ box next to the ‘Attributes’ option is ticked. So you will have to checkmark the ‘Read-only’ option
  • After that, you have to click on the OK button from the bottom of the window
  • It will bring out another new popup. Simply choose the ‘Apply changes to this folder, subfolders, and files’ option
  • Finally, you have to click on the OK button once again
  • After that, you should restart Microsoft Excel and then try to edit or delete the macro. And you will see that this time you can edit or delete the macros without any error

Method #3 Try Disabling the Add-ins

Add-ins on MS Excel are of great help. However, sometimes, some add-ins could be the reason why you are not able to edit or delete the macro. In that case, the solution is to disable the add-ins.

Cannot Edit a Macro on a Hidden Workbook

Then you can try to edit the macros without the add-ins and see if that works or not. Here’s how to disable the add-ins in MS Excel.

Steps to Follow

  • Open MS Excel if you haven’t already
  • Next, you will have to click on the File option from the top left corner of the screen
  • Next, you have to click on the Options from the overlay menu
  • After that, you have to select the Add-ins option
  • At this point, you will have to select ‘COM Add-ins’ next to the Manage option from the Excel option window
  • After that, you will have to click on the Go button
  • Next, you need to uncheck all the checkboxes from the next window
  • Then, you need to select Excel Add-ins from the dropdown menu next to Manage
  • After that, you should uncheck all the Add-ins from the new popup window and click on the OK button
  • Finally,  you have to click on the OK button to save the new settings

After you have disabled the add-ins, you need to restart MS Excel. Now, you should check whether you can edit or delete macros without the error appearing.

Method #4 Try Repairing Corrupted Excel Workbook

If you have tried the methods described above and still couldn’t fix the error, then the problem might be somewhere else. It could be that the Excel workbooks are corrupted. So, the only solution to that is to repair those files.

To repair an Excel Workbook file, you will need to use 3rd-party software. However, if you don’t want to use that software, you can try re-installing MS Excel. We hope this will solve the ‘cannot edit a macro on a hidden workbook’ error.

Method #5 Try Modifying Windows Trust Center Security Settings

This is a method that you don’t have to try in most cases. However, in some scenarios, you should check this one out to solve the error. Normally, Windows has security settings in place to protect your PC.

On the other hand, those security settings could be the issue that is creating the ‘cannot edit a macro on a hidden workbook’ error. So you should modify some of those security settings to see whether the error disappears. Here’s how to do it.

Steps to Follow

  • First of all, click on the File option from the top left corner of the Excel window
  • Next, you need to tap on the Options from the overlay menu
  • After that, you will need to click on the Trust Center option from the left side pane
  • Next, you will have to click on the ‘Trust Center Settings…’ from the right side of the window
  • In doing so, a new window named ‘Trust Center’ will appear on the screen. You have to select the Marco Settings option from the left side pane
  • After that, you have to click on the ‘Enable all macros (not recommended; potentially dangerous code can run)’ option
  • Then you need to click on the OK button and the window will be closed

Now, you should restart MS Excel and try to edit any macros and see if the error is still appearing. Remember, if you are suspicious of running malicious code, then you should disable these security settings.

To do that, just follow the similar steps mentioned above. Simply this time, you have to choose the ‘Disable all macros without notification option from the ‘Trust Center’.

Method #6 Try Saving the Document in XLSM Format

Normally, macros are saved in XLSM format. That way, MS Excel recognizes the macros without any problems. However, sometimes, you might have saved the macros in XLSX format. In that case, you will not be able to edit or delete these macros.

So make sure, you are saving the macros in XLSM file format. Now, if you have not done that in the first place, you should rename your files that have the macros. So you should navigate to the folder where your Excel macros are saved.

Also, you should ensure that you are saving the macros using macro-enabled template. Once you have done all the above-mentioned things, you should be able to edit or delete any macros without the error appearing.

Additional Tip – How To Unhide A Workbook To Edit A Macro?

For avid Excel users, this tip might come in handy. There are times you need to unhide a Workbook to edit a Macro. But if you don’t know how to unhide a Workbook, you will be stuck there.

Cannot Edit a Macro on a Hidden Workbook

So in this part of the post, we will be talking about how to unhide a Workbook in Excel. So let’s learn how to do that.

Steps to Follow

  • On Microsoft Excel, you have to click on the File option
  • Then navigate to the Options which is available at the bottom left bar
  • After that, you will have to select the Trust Center option from the left side pane
  • Next, you have to click on the Trust Center Settings… option
  • In doing so, a new dialog box will appear on the screen. You will have to click on the Macro settings which will be on the left side of the screen
  • Next, you will have to select the Enable all macros option
  • Finally, you have to click on the OK button to save the settings

Final Lines

If you are here, then you know all the different ways you can fix the ‘cannot edit a macro on a hidden workbook’ error on MS Excel by now. So it is your turn to check out which method works out for you. Don’t forget to share which method worked for you to fix the error.

We hope this post was helpful in fixing the issue with editing macros on MS Excel. Still, if you have any queries about this, you can let us know in the comments below. You can share this post if it was helpful to you.

More useful posts

How to insert dash in excel between numbers
Excel might be an old software, but it’s still one of the most useful tools out there. Learn about it here

Avatar photo

About the Author: Jakaria Tiaz

Jakaria brings years of extensive experience in tech and business writing to the team. After working as the chief editor for several very large online magazines Jakaria agreed to take part in Tech 25 and help turn it into the leading Tech news and facts site online.