Tag Archives: designer compile error

Designer Compile Error: Cannot run the macro ‘OnLoad’


After installing Microsoft’s August 2012 security updates on a machine with the OfficeWriter Designer installed, you may encounter the following:

Office 2003, 2007, or 2010 throws an error when opening: Compile error: Automation error Unspecified Error followed by Cannot run the macro ‘OnLoad.’ The macro may not be available in this workbook or all macros may be disabled.


One of the Microsoft August 2012 security updates targeted a vulnerability in Windows Common Controls: MS12-060 – Vulnerability in Windows Common Controls.

On the detail page (2720573), it mentions that there is a known issue with all versions of Office when installing this update:

“Windows Common Control-based embedded Active-X controls may fail to load within pre-existing office documents, within third-party applications, and when you insert new controls in developer mode.”

This affects the OfficeWriter Designer as well.


Alternate error message:

Compile error: Automation error Unspecified error

This may also affect customers who switch between Word 2007 and Word 2010. When you switch back to Word 2007, this error may be re-introduced and you will need to follow the solution steps again.


To resolve this issue, MSCOMCTL.OCX must be re-registered on the machine:

1. Run the command prompt as Administrator

2. Register MSCOMCTL.OCX:

  • For 64-bit operating systems, type the following: Regsvr32 “C:\Windows\SysWOW64\MSCOMCTL.OCX”
  • For 32-bit operating systems, type the following: Regsvr32 “C:\Windows\System32\MSCOMCTL.OCX”

3. A computer restart may be necessary

For more information about resolving this issue, please refer to the following Microsoft KB articles for Office 2010Office 2007, or Office 2003.

Designer Compile Error: Object library invalid or contains references that cannot be found


When the OfficeWriter Designer is installed, Excel or Word throws a VBA compilation error:

Object library invalid or contains references that cannot be found.

This error can occur if you installed a version of Office on a system in which the Office Designer had already been installed for a different version of Office. For example, you were using OfficeWriter Designer with Office 2007, then later installed any component of Office 2010, including SharePoint Designer 2010 (which is a part of the Office Suite). The error does not go away even if you uninstall one Office version.

This problem will not occur if you install OfficeWriter Designer for the first time on a system which is already running two versions of Office side-by-side.

The error is thrown at startup when Excel or Word attempts to load the add-in template which contains the VBA code for the OfficeWriter Designer. Excel or Word is attempting to use a cached, incompatible version of certain Microsoft control type libraries.


Resolve the error by removing all cached control type libraries as follows:

  1. Close all running instances of Excel or Word
  2. Navigate to \users\USERNAME\appdata\roaming\microsoft\forms
  3. Remove all *.exd files
  4. Start Excel or Word. Upon starting, the compatible version of the required .exd files will be automatically restored.

Update 4/10/2012: This issue might also occur if you installed the Microsoft April 2012 security update on a machine that had the OfficeWriter Designer installed. For more details about the April 2012 security update specifically, please refer to Microsoft’s kb article.

Update 8/12/2012: Similar issues may be the result of the August 2012 security update. If following the steps listed above do not resolve the issue, please try following the steps listed in this OfficeWriter kb article.