How to Fix Word Compile Error in Hidden Module Link Word

When launching Microsoft Word, opening a document, or quitting the application, users may encounter a modal Visual Basic for Applications (VBA) dialogue stating Compile error in hidden module: [ModuleName] (commonly referencing link_word, ThisDocument, or AutoExec). This error indicates that a protected, password-encrypted macro contained within a global startup template or add-in is incompatible with your current architecture of Office. It frequently appears after upgrading to 64-bit Office while legacy 32-bit third-party add-ins remain installed.

Remove Incompatible PDFMaker and Third-Party Startup Templates

The most frequent culprit behind the hidden module error is an outdated Adobe Acrobat PDFMaker template (pdfmaker.dot or pdfmaker.dotm) installed in Word’s global startup folder.

  1. Close all open instances of Microsoft Word and Outlook.
  2. Press Windows Key + R to open the Run dialogue.
  3. Copy and paste the following path into the box and press Enter:
    %appdata%\Microsoft\Word\STARTUP
  4. Inspect the folder contents for any template files (such as pdfmaker.dot, pdfmaker.dotm, or link_word.dot).
  5. Select these files and move them to a temporary backup folder on your Desktop.
  6. Next, navigate to the secondary Office startup directory:
    C:\Program Files\Microsoft Office\root\Office16\STARTUP
    (or Program Files (x86) if running 32-bit Office).
  7. Remove any third-party add-in templates located there as well.
  8. Launch Microsoft Word to confirm that the compile error prompt is eliminated.

Disable Defective COM Add-Ins via Safe Mode

If moving template files from the startup folders does not isolate the hidden module, a registered Component Object Model (COM) add-in is loading into Word’s process memory during startup.

  1. Press Windows Key + R, type winword /safe, and press Enter to launch Word in Safe Mode. Safe Mode bypasses all automated macro execution and add-ins.
  2. Click File > Options.
  3. Select the Add-ins tab in the left column.
  4. At the bottom of the window, ensure the Manage dropdown is set to COM Add-ins and click Go.
  5. Untick third-party add-ins (especially Acrobat PDFMaker Office COM Add-in, Send to Bluetooth, or citation managers like EndNote).
  6. Click OK, close Word, and relaunch it normally.

Rebuild the Global Normal.dotm Template

If macros or custom styles stored in the master global template become corrupted, Word will fail to compile the underlying Visual Basic project code on launch.

  1. Close Microsoft Word.
  2. Press Windows Key + R, type %appdata%\Microsoft\Templates, and press Enter.
  3. Locate the master template file named Normal.dotm.
  4. Right-click Normal.dotm, select Rename, and change the name to Normal.dotm.old.
  5. Relaunch Word. Word will automatically generate a clean, uncorrupted factory default Normal.dotm template, clearing legacy macro project errors.

Register MSCOMCTL.OCX and Windows Common Controls

On 64-bit Windows installations, outdated 32-bit user interface control libraries used by custom VBA macros can trigger compile failures when calling missing ActiveX objects.

  1. Click Start, type cmd, right-click Command Prompt, and select Run as administrator.
  2. Execute the following registration command:
    regsvr32 C:\Windows\SysWOW64\mscomctl.ocx
  3. If the OCX library exists, a dialogue will confirm successful registration. Relaunch Word to verify stability.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.