Search code examples
.netvb664-bitmsscriptcontrol

Unable to cast COM object of type 'MSScriptControl.ScriptControlClass'


Got this error when deploying a VB6 / .NET application on a 64-bit Windows 2008 machine.

Unable to cast COM object of type 'MSScriptControl.ScriptControlClass' to 
interface type 'MSScriptControl.IScriptControl'. This operation failed because the 
QueryInterface call on the COM component for the interface with IID '{xxx}' failed 
due to the following error: Error loading type library/DLL. (Exception from HRESULT:
0x80029C4A (TYPE_E_CANTLOADLIBRARY)).

Solution

  • To solve, run the following command

    RUN CMD AS ADMINISTRATOR

    regsvr32 C:\Windows\SysWOW64\MSScript.ocx