How to Fix Error in Hidden Module

If you are getting error messages like “error in hidden module” or “undefined reference”, the problem is easy to fix! The following is what this message typically looks like:

Compile error in hidden module message

What is upsetting about this error is that it can occur after you have been using an add-in for years. And the message above from Microsoft implies that the add-in is incompatible with Excel. This is not true!

The error you are receiving is because of a Microsoft Office update that changed an Excel setting. Specifically, Microsoft changed the trust center setting on ActiveX controls to disable all controls — and did not tell or ask you about the change. Why is this important? Controls are what are used in add-ins and macros to get input from a user, like a range of cells to be searched or used. When Microsoft disabled all controls, the result is an error in an add-in’s module. This caused the above message to appear, and the add-in will not work.

Microsoft appears to be doing this change on a random stealth basis, changing the setting on only a small number of users with each update. Unfortunately, they forgot that a key Microsoft ActiveX control is the one that allows users to select a range of cells on a dialog. When this control is present in an add-in and disabled by this ActiveX change, the error in hidden module occurs when one tries to run our add-ins. Hopefully they will one day fix it.

In Excel do the following:

  • File
  • Options
  • Trust Center (at the bottom of the options on the left)
  • On the right side of the panel that appears, click the Trust Center Settings link.
  • Select ActiveX Settings on the left side. (this is seldom the one that is selected by default)
  • Select the second option:
Excel ActiveX settings panel
  • As info, this is the setting we use and the default for years prior to the Office update that changed the setting.
  • This setting warns you if a setting is unsafe and allows the use of safe for initialization controls, which are the ones we use.
  • Click OKs to close the dialogs.

Now close and reopen Excel to make the change go into effect. Again, close Excel and reopen. All should work.

There is a chance on a future Microsoft Office update that they will again change the above setting, and you will once again get the message “error in hidden module”. If this happens, repeat the above steps. As information, the latest releases of our add-ins do not have this error problem created by Microsoft updates.