Skip to main content

Word – Fix Compile error in Hidden module

By January 26, 2023June 27th, 2023No Comments

When you are working with Word or Excel and are using macro’s and you receive the following error “Compile error in hidden Module” you are probably missing Microsoft Visual Basic Common Controls. This is a .ocx file the should recite in your system32 or syswow64 folder. So the fix is pretty simple here:

Step 1 – Check if you have the file

Open your system folder and check if you have mscomct2.ocx or mscomctl.ocx

1.  %windir%\syswow64   or %windir%\system32

If you have the files, the problem is something else. It could be a template-type addin that isn’t compatible with your Word version or something else. Either way stop reading here and start Googling.

Step 2 – Copy the file

Crap the file from another machine (if you have one where everything is working fine) or download it here or here and copy the file to:

1.  %windir%\syswow64   or %windir%\system32

Step 3 – Register the OCX file

The last step is to register the file, run the following command the register it:

1.  Regsvr32 /s "C:\Windows\SysWOW64\mscomct2.ocx"

The /s option is to run the command in silent mode, useful when you are using SCCM or PDQ Deploy.

That should be all, restart is not needed, everything should work fine now.