Javascript error “Library not registered” or “Element not found” in Sharepoint

These errors appear when trying to use some javascript enabled features in SharePoint. The error is triggered when running the command IMNControlObj.OnStatusChange=IMNOnStatusChange; inside of init.js. This command triggers a call to the Name.NameCtrl.1 ActiveX Control. This control is contained within name.dll which is included with all office installations. A conflict is caused when attempting to load this library due to a broken reference inside of the windows registry. In my experience this is common when upgrading from Office 2003 to Office 2010, as the references to the new name.dll are not updated.

To solve this issue you must run the repair wizard from within an office application, the process of which will depend on the version installed. I will use Word as an example since it is the most popular case.

Word 2003

Enter the Help menu, then select Detect and Repair. Make sure “Discard my customized settings and restore default settings” is checked.

Word 2007

Click the Office button, select Word Options, goto the Resources tab and finally, Diagnose.

Word 2010

Office 2010 products don’t have any repair function available. However, the old repair feature from previous versions of word are still accessible through code, and will solve our problem.

Create a macro. Under the View tab, select View Macros. Enter a macro name, “RunRepair” for example, and click Create. The script editor will open with a stub Sub created for you. Edit the code so it resembles the following:

Sub RunRepair()
    Application.CommandBars.FindControl(ID:=3774).Execute
End Sub

Save your macro and return to the View Macros window. Select your macro and click Run. The repair wizard should appear. Make sure you check “Discard my customized settings and restore default settings” before running the wizard.

1 Comment

  1. Falconsfire · September 7, 2011 Reply

    if this works you are a legend

Leave a Reply