Microsoft visual basic for applications compile error in hidden module excel

In this ArticleViewing a Hidden ModuleFixing a Syntax ErrorFixing a Missing ReferenceCheck the Excel Start up FolderUsing Add-ins and Macros from Other Providers This article will demonstrate how to fix the VBA Error: Compile Error in Hidden Module. The VBA Compile Error in Hidden Module occurs when you are using a VBA macro in Excel…

Return to VBA Code Examples

In this Article

  • Viewing a Hidden Module
  • Fixing a Syntax Error
  • Fixing a Missing Reference
  • Check the Excel Start up Folder
  • Using Add-ins and Macros from Other Providers

This article will demonstrate how to fix the VBA Error: Compile Error in Hidden Module.

The VBA Compile Error in Hidden Module occurs when you are using a VBA macro in Excel which is stored in a hidden module. This might be due to the fact that you are using an External Add-in, or you may have created your own program in a previous version of Excel that no longer works in your current version of Excel. As the error says the module is hidden, then the code is most likely protected by a password and not normally available for the user to Edit.

vbacompile hidden module

Viewing a Hidden Module

The first thing to do to solve the problem would be to see if you can unhide the hidden module.

Press Alt+F11 to go to the VBE Editor.

OR

In the Ribbon, select Developer > Visual Basic.

vbacompile vbe

Note: If you don’t see the Developer Ribbon, you’ll need to enable it.

You will then be able to view your hidden module and fix the error.

Fixing a Syntax Error

(1) Double-click on the VBA Project that contains the hidden module, and then, (2) type in the Password.

vbacompile password

In the Menu, select Debug > Compile to compile the project.

vbacompile debug

The compile error should immediately pop up.  In this case we have a simple syntax error in the code.

vbacompile syntax error

Fix the error, and then click Debug > Compile again.  Once the project is successfully compiled, the compile option will be greyed out.

vbacompile compiled

Save the project to keep your changes.

vbacompile save file

Fixing a Missing Reference

Another common reason for a compile error in Excel is a missing reference. First, unhide your module in the same way as shown above, and then in the Menu, select Tools > References.

vbacompile error reference

Scroll down through the list of references to find the one you want to use.  In this case, the Microsoft Word 16.0 Object Library.

vbacompileerror add reference

(1) Select the reference and then (2) click OK and then Save your File.

Check the Excel Start up Folder

You may find that you have an add-in installed that you no longer require and these may be causing issues when you try and open Excel.

Make sure Excel is closed and then, in the File Manager of your PC, go to the XLSTART folder (this is usually located in C:UsersUSERNAMEAppDataRoamingMicrosoftExcel).

Remove any Add-ins (XLA or XLAM files) that you are not using.

Restart Excel.

Using Add-ins and Macros from Other Providers

If you use macros or add-ins from an external provider, chances are you are not going to have access to the password to fix your compile error. If this is the case you would need to contact the provider of the add-in or macro in order to update it to your version of Excel. To solve the compile error problem you would need to disable the add-in.

In the Ribbon, select Developer > Add-ins, and then select either Excel Add-ins or COM Add-ins.

vbacompile select addins

Remove the check mark from any selected add-in that is causing combability issues, and then click OK.

Close and Re-Open Excel.

VBA Coding Made Easy

Stop searching for VBA code online. Learn more about AutoMacro — A VBA Code Builder that allows beginners to code procedures from scratch with minimal coding knowledge and with many time-saving features for all users!
vba save as

Learn More!

You might receive a “Compile Error in Hidden Module” error message when you start your Excel.

Whether it is Excel or any other Microsoft Applications from time to time they are prone to errors. This Compile Error in Hidden module occurs in both MS Excel and MS Word but in this blog, you will get to know how to repair Compile Error in Hidden module in Excel.

When you start MS Excel the particular error message that displays on the screen is:

Compile error in hidden module: AutoExec

Compile error in hidden module: AutoExecNew

Compile error in hidden module: DistMon

If you are using an older version of Windows like Windows 95/98 then you might receive an error message that says:

Excel has performed an error in module excel.exe and will be closed.

For Windows 2000 and above version the error appears like:

Excel has encountered a problem and needs to close. We are sorry for the inconvenience.

After the error message is displayed, an error report will be presented which provide the additional information of that error, a link will be shown something like:

– 9.0.0.5302 – Vbe6.dll – 6.0.89.67 – 0000d799

Just click on the link to view full details of that error and depending on the application that has been crashed you might see the location to excel.exe which will guide you to the culprit of this error message.

To repair Compile Error in Hidden module go through the solutions one by one but before that get to know why does this Compile Error in Hidden module in Excel appears.

To recover Excel corrupt module, we recommend this tool:

This software will prevent Excel workbook data such as BI data, financial reports & other analytical information from corruption and data loss. With this software you can rebuild corrupt Excel files and restore every single visual representation & dataset to its original, intact state in 3 easy steps:

  1. Download Excel File Repair Tool rated Excellent by Softpedia, Softonic & CNET.
  2. Select the corrupt Excel file (XLS, XLSX) & click Repair to initiate the repair process.
  3. Preview the repaired files and click Save File to save the files at desired location.

Why Does Compile Error In Hidden Module In Excel Appear?

Microsoft is upgrading Office 2016 from 32-bit version to 64-bit version. This Compile Error in Hidden module error message usually appears when there are dome 32-bit add-ins versions of office which are incompatible with the newer version.

The most common reason behind this error is when some conditions come true:

1: MS Excel startup folder when contains both the template files on Adobe Acrobat PDF Maker add-in:

Pdfmaker.dot
Pdfmaker.xla

2: Software named Norton Anti-virus software has been installed.

Now, that you know the reason that causes Compile Error in Hidden module in Excel. Let’s begin with the solutions to fix this error.

1: Re-register OCX Files Using CMD

To fix compile error in hidden module you need to re-register some files basic to the functionality of Excel. Follow the steps:

  • Start your system with the Administrative rights
  • Press Windows + R key
  • Type “cmd” and click on OK

  • Depending on the version type the following commands and press enter:

For 32-bit version

regsvr32 -u c:windowssystem32mscomctl.ocx
regsvr32 c:windowssystem32mscomctl.ocx

For 64-bit version

regsvr32 -u c:windowssyswow64mscomctl.ocx
regsvr32 c:windowssyswow64mscomctl.ocx

Now, run MS Excel and see whether Microsoft visual basic compile error in hidden module is solved or not.

2: Try Deleting .exd Files

If the above-given solution did nor work then try deleting the .exd files from your folder, this might help you in fixing the compile error in the hidden module in excel. Follow the steps to delete files:

  • Press Windows + R key
  • Type %appdata% and click OK

  • This will open the Application Data folder, now select Microsoft

  • Open the Forms folder

  • Select comctllib.exd and mscomctllib.exd, Right-click on them and Delete

Deleting the .exd files will let you start Excel and the compile error in the hidden module issue will be resolved.

3: Move PDF Maker Files

If you are using Adobe Acrobat PDF Maker then to solve this issue you need to move the Pdfmaker.dot file and Pdfmaker.xla files to a different location. To do so follow the steps given below:

  • Click on the Windows icon and type pdfmaker. *

  • Click on all files and folders.

  • In the All or part of the file name type pdfmaker. * and search

  • Once the files are located, right-click on the pdfmaker.dot & pdfmaker.xla, and select the Cut.

  • Go to the Desktop and Paste it

After moving the PDF files by performing the above-stated steps compile error in the hidden module excel issue must be solved.

4: Update Latest Version of Adobe Acrobat

If the above method mentioned didn’t fix the Excel Compile error in the hidden module 2016 problem, then you can try updating the Adobe Acrobat version.

To update the add-in Adobe Acrobat, visit the official website of Adobe. You can find the newest updates in the search engine by searching the Adobe Acrobat Updates.

After updating the Adobe Acrobat restart your system and see if the compile error in hidden module Excel problem is solved or not.

5: Fix “Compile error in hidden module” Module 1

This error also occurs when you have recently upgraded or might have saved an Excel file that was created in different locations between versions.

To fix Excel compile error in hidden module  issue follows the simple steps mentioned below:

  • Select the file that is wrongly saved in Excel
  • Press AltF11 to go into the file Visual Basic Editor.
  • From the Tools menu, select the References
  • Scroll down to the Available References box and uncheck all that starts with MISSING:
  • Press AltQ when all the reference errors have been unchecked.

These steps will help you to fix the compile error in hidden module 1 issue.

Automatic Solution: MS Excel Repair Tool

If you are finding the above solutions difficult to perform and if you are unable to solve compile error in hidden module Excel issue, then you can try running MS Excel Repair Tool.

This is an advanced repairing tool that not only repairs damaged, corrupted, or inaccessible Excel files and all sorts of Excel errors but also recovers deleted, lost data from chart sheets, cell comments, formulas & others.

One can easily use this tool without the need for any professional and it supports all Excel versions.

* Free version of the product only previews recoverable data.

Steps to Utilize MS Excel Repair Tool:

Conclusion:

So, this was all about compile error in hidden module Excel. Well, I have tried my best to put together all the working solutions together to fix this issue.

Carefully follow the solutions given one by one. They are easy to use and had worked for many users.

Hope you liked this article and it worked for you in fixing the compile error in hidden module excel issue and making your Excel work again without any error.

Apart from this if you have any suggestions or queries then feel free to share them with us in the below comment section.

Priyanka is an entrepreneur & content marketing expert. She writes tech blogs and has expertise in MS Office, Excel, and other tech subjects. Her distinctive art of presenting tech information in the easy-to-understand language is very impressive. When not writing, she loves unplanned travels.

When talking about MS Office error messages, it’s always a long story. Users would report hundreds of different error messages they received when they open Word, Excel, or PowerPoint. For some common errors like Runtime Error 1004 or add-in template is not valid, we have already introduced how can you fix them. This time, we will talk about another error message — Compile error in hidden module.

Users often received this error message when they start Excel. In rare times, when users start MS Word, this error would also pop up. Usually, users would see one of the following error messages:

  • Compile error in hidden module: AutoExec
  • Compile error in hidden module: AutoExecNew
  • Compile error in hidden module: DistMon

Compile error in hidden module

The different suffixes indicate that you have different culprits to blame, and that’s why there is more than one solution for you to solve the problem. Before checking the solutions, you should know the reasons why you see these error messages.

Why Do I See the Error Message of Compile Error in Hidden Module?

Now Office 2016 is upgraded from a 32-bit version to a 64-bit version. The Compile error in hidden module error message usually appears when there are dome 32-bit add-ins versions of the office in your computer, and they are incompatible with the 64-bit version.

Two common conditions that would cause this error are as follow:

1. When MS Excel startup folder contains both the following two template files on Adobe Acrobat PDF Maker add-in:

  • Pdfmaker.dot
  • Pdfmaker.xla

2. Your computer has installed the Norton Anti-virus software.

After knowing what causes this error message, now it’s time to apply the solutions. Here we have listed four solutions, you can try them one by one until you solve the problem.

Method 1. Re-register OCX Files with CMD

The first solution you can try is to re-register some basic Excel function files. In this method, we need to apply Windows Command Prompt.

Step 1. Press Windows + R keys at the same time. Type cmd in the run box.

Open cmd in Run box

Step 2. Type the following command and press Enter.

For 32-bit:

regsvr32 -u c:windowssystem32mscomctl.ocx

regsvr32 c:windowssystem32mscomctl.ocx

For 64-bit:

regsvr32 -u c:windowssystem64mscomctl.ocx

regsvr32 c:windowssystem64mscomctl.ocx

Step 3. Now run MS Excel again to check if the error message still exists.

Method 2. Delete .exd Files

The exd file is a control information cache file of Microsoft Office. These files are created when a user inserts an ActiveX control into a document using the Control Toolbox in an MS Office program. You can delete this cache file to see if it can fix the Compile error in the hidden module error.

Step 1. Press Windows + R keys at the same time. Type %appdata% in the run box.

Step 2. It will open your AppData folder. Go to Roaming > Microsoft > Forms.

Step 3. Find the .exd files, select comctllib.exd and mscomctllib.exd, and delete these two files.

Step 4. Restart your Excel and check if the problem is solved.

Method 3. Move PDF Maker Files

As we have mentioned above, one of the reasons you will see this error message is because there are two template files on Adobe Acrobat PDF Maker add-in. So in this method, you can move the PDF Maker files to another place to fix your problem. Here are the detailed steps.

Step 1. Open Windows File Explorer, search pdfmaker.* on your computer.

Step 2. Choose the pdfmaker.dot and pdfmaker.xla files, right-click on both files, and select cut.

Step 3. Paste these two files to your Desktop.

Now you can restart the MS Excel to see if the problem is solved.

Method 4. Update to the Latest Adobe Acrobat

If the above methods can’t help you solve the Compile error in hidden module problem, the last resort is to update the Adobe Acrobat to the latest version. It’s because this problem is associated with the Adobe Acrobat that is installed on your computer.

Go to the Adobe official website, find the latest version of Acrobat, download and install it on your computer.

related articles

How to Fix Word Runtime Error 91?

A runtime error is a common program error that usually occurs in Microsoft Office software. This article will you what is the reason for this error, and how to fix it.

runtime error 91

Bonus Solution: Repair Damaged or Corrupted MS Excel Efficiently

With the above methods, you might have solved the Excel Compile error in the hidden module issue. Then we’d like to share a good bonus tool — EaseUS Data Recovery Wizard with you. 

This is an advanced 4-in-1 specialized fix tool that enables you to repair corrupted  PDF documents and Office files in multiple formats. If your documents got damaged, Stellar file repair software will scan and repair them efficiently. 

If you want to try on this file repair software, you can download it and follow the guide to see how to use this tool. In the following guide, we have introduced how to repair Excel documents.

Step 1. Launch EaseUS Data Recovery Wizard. Select a disk location where the corrupted files are saved. Click «Scan» to start finding the broken files. EaseUS file repair tool allows you to fix damaged documents, videos, and pictures in differnet formats. 

select a location and click scan

Step 2. After scanning, you can quickly find corrupt data by file type. If you want to repair damaged Word, Excel, or PDF, select Documents and filter a specific category. For pictures and videos repair, all the common types are suppored, including JPEG, PNG, BMP, MOV, MP4, GIF, and more.

check scanned corrupt files

Step 3. EaseUS file repair software will automatically fix broken files. You can preview the repaired files before recovery. Last, click «Recover» and save the recovered files to a different location to avoid data overwriting.

recover and repair corrupted files

The Bottom Line

That’s all about Compile error in hidden module error message. Hope you can fix your problem after reading this article. Once again, we’d like to introduce EaseUS file repair tool. No matter whether you need to repair Word, Excel, PPT, or PDF documents, applying this tool is a wise choice.

Compile error in a hidden module is an error message that may be shown for some Microsoft Word and Microsoft Excel users. This message is generally displayed when Office users open Word or Excel. After this message, the application does not launch.

Fix Compile error in hidden module in Excel or Word

This error occurs when the code is incompatible with the version or architecture of this application. For instance, if code in a document targets 32-bit Microsoft Office applications but it is attempting to run on 64-bit Office, then this error can occur.

Says Microsoft.

The error is raised when a compilation error exists in the VBA code inside a protected (hidden) module. The specific compilation error is not exposed because the module is protected.

Try the following suggestions to fix the issue:

  1. Unprotect the VBA code module
  2. Re-registering OCX files with the Command Prompt
  3. Updating Adobe Acrobat
  4. Moving PDfmaker files to another folder
  5. Updating or Uninstalling the Norton Antivirus software

Let us look at these ways in more detail.

Compile error in hidden module

1] Unprotect the VBA code module

Now, if you are facing this error, do the following:

  • If you have access to the VBA code in the document or project, unprotect the module, and then run the code again to view the specific error.
  • If you don’t have access to the VBA code in the document, then contact the document author to have the code in the hidden module updated.

This is the official workaround. If that does not help, try the following suggestions:

2] Reregistering OCX files with the Command Prompt

The compile error in hidden module error could also be a side effect of Windows updates. Hence, registering a mscomctl.ocx file may fix the issue. To reregister the OCX file, follow the given steps:

Press Windows + X hotkey. Choose Command Prompt (Admin) to run the prompt as an administrator.

In the case of a 32-bit Windows computer, provide the following commands in the prompt:

regsvr32 -u c:windowssystem32mscomctl.ocx
regsvr32 c:windowssystem32mscomctl.ocx

In the case of a 64-bit Windows computer, provide the following commands in the prompt:

regsvr32 -u c:windowssyswow64mscomctl.ocx
regsvr32 c:windowssyswow64mscomctl.ocx

3] Updating Adobe Acrobat

This applies to you if you are using Adobe Acrobat.

The compile error in hidden module error could also occur due to two Adobe Acrobat template files in MS Office folders. It is advisable to install the Adobe software from an official website to avoid this error. In case you come across this error, you can export PDFs into other Microsoft 365 like Word, Excel, or PowerPoint. You can update Adobe by clicking on Help in Adobe’s window. Choose Check for Updates to open the updater window. You can then press the Download and Install button in case of any update.

4] Moving PDFmaker files to another folder

This applies to you if you are using PDFmaker

The compile error in hidden module error is connected to two Adobe Acrobat files i.e. PDFmaker.xla and PDFmaker.dot. Hence, moving these files out of the MS Office folders may also fix the error. You can also follow the below steps:

  • Press Type here to search button and open Cortana’s search box. Type PDfmaker.xla in the search box to look for that file.
  • Type PDFmaker.dot in the search box to look for the file. Right-click the said files and choose Open file location to open the folders in the File Explorer.
  • In case you cannot find the files, you can open the MS Office Start-up and Xlstart folders in the File Explorer.
  • Right-click on the files in the File Explorer and choose the Cut option to move the PDfmaker files to the desktop. Right-click another folder to move them and choose Paste.

5] Update or Uninstall the Norton Antivirus software

This applies to you if you are using Norton software

The Norton Antivirus may also be connected to compile error in hidden module error. If it is installed, updating the software can fix the issue. You can check for updates by pressing the Update Me Now button. You can right-click the Norton Antivirus system tray icon and choose Norton LiveUpdate.

In case a Norton Antivirus update does not fix the issue, you can uninstall the Norton software.

Press Windows + R shortcut to open the Run windows.  Type appwiz.cpl in Run, and click on the OK button. Choose the listed Norton Antivirus software and click on the Uninstall button to remove the software after confirmation.

We hope that one of the above-mentioned solutions helps you fix the compile error in hidden module error and re-launch Word and Excel. Do let us know in case of any queries or suggestions.

How do I open Excel in safe mode?

You can open Excel in safe mode by pressing and holding the Ctrl button as you start the program. You can also use the safe switch (excel.exe/safe) when you start the program from the command line.

Fix: The file is corrupt and cannot be opened error in Word, Excel, PowerPoint

What is the safe mode in Microsoft Word?

When you cannot use Microsoft Office normally, you can use a built-in safety feature. If Word or Excel crashes every time you open it, you can start the said application in safe mode and it helps you work normally.

When using Excel or Word, you may get this error message “compile error in hidden module”. What should you do to get rid of the Word or Excel compile error in Windows PCs? Take it easy and now you can get some easy methods from this post offered by MiniTool.

When launching Excel or Word, the message “compile error in hidden module” may appear on your computer screen. The module can be thisworkbook, hstbarpublic, menuandtoolbar, aowd, etc.

Why does the compile error happen? This is because Microsoft upgrades Office 2016 from 32-bit version to 64-bit version but there are incompatible 32-bit add-ins on the Office. That is, some add-ins contain a code that is incompatible with the current version of the Office 2016.

What should you do to get rid of the error? Solutions are for you below.

Upgrade Adobe Acrobat

Two Adobe Acrobat template files in the Office folder can cause the compile error message. One possible solution is to upgrade Adobe Acrobat.

Step 1: Click this app, go to Help > Check for Updates.

Step 2: If there are updates, press Download and Install.

Use CMD to Register OCX Files

To fix excel compile error, you need to register some files basic to the Excel’s functionality. Just follow these instructions:

Step 1: Launch Command Prompt (CMD) with admin privileges.

Step 2: Type the following commands and press Enter after each one:

On 32-bit Windows:

regsvr32 -u c:windowssystem32mscomctl.ocx

regsvr32 c:windowssystem32mscomctl.ocx

On 64-bit Windows:

regsvr32 -u c:windowssyswow64mscomctl.ocx

regsvr32 c:windowssyswow64mscomctl.ocx

Register OCX Files

Step 3: Run Excel and see if you have fixed compile error in hidden module.

Move Pdfmaker Files to Another Folder

Pdfmaker.xla and pdfmaker.dot are two Adobe Acrobat files, causing the compile error. So, you can move these files out of the MS Office folders to fix the issue.

Step 1: Type pdfmaker.xla to the search box and right-click it to choose Open file location.

Step 2: In File Explorer, copy and paste this file to another folder like the desktop.

Step 3: Do the same to the pdfmaker.dot file.

Now, you should get rid of compile error in hidden module.

Delete .exd Files

If the above solutions don’t work, you can try deleting .exd files from your computer. This may be helpful to fix excel or word compile error in hidden module.

Step 1: Press Win + R, input %appdata% and click OK.

Step 2: Click Microsoft > Forms.

Step 3: Right-click comctllib.exd and mscomctllib.exd, and click Delete to remove them one by one.

Update Norton Antivirus

Norton Antivirus may be related to compile error in hidden module. If your desktop or laptop has this software, updating it may be helpful to fix the issue.

Step 1: Go to this link and click Update Me Now.

Step 2: Click the .exe file to run it and finish the update.

If the update cannot fix your issue, you can choose to uninstall this antivirus software from your computer and see if the error is removed. Just refer to this post — Four Perfect Ways: How to Uninstall Programs in Windows 10.

The End

Are you bothered by compile error in hidden module when using Word or Excel? Take it easy. After trying these methods, you should easily and effectively get rid of this issue.

Понравилась статья? Поделить с друзьями:
  • Microsoft visual basic compile error can t find project or library
  • Microsoft visual c runtime library runtime error this application has requested the runtime
  • Microsoft visual c runtime library runtime error r6002 floating point support not loaded
  • Microsoft visual c runtime library runtime error program c r6025 pure virtual function call ок
  • Microsoft vbscript runtime error invalid procedure call or argument