Unable to cast COM object of type

Last post 07-30-2009 4:31 AM by SSA. 3 replies.

Sort Posts:

  • Unable to cast COM object of type

    07-27-2009, 10:13 PM
    • Member
      2 point Member
    • HenryHan
    • Member since 07-08-2008, 1:28 AM
    • Posts 20

    Hi,

    I'm having a problem when I play my web application on localhost the chart be able to plot perfectly BUT when I access it thru the web from another PC the below error occured:-

    System.InvalidCastException: Unable to cast COM object of type 'Microsoft.Office.Interop.Owc11.ChartSpaceClass' to interface type 'Microsoft.Office.Interop.Owc11.ChChartSpace'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{CED63FEC-9BAE-48D2-BC75-38BA0F71F730}' failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)). 

    Anyone any idea to solve the above?

     

    Thanks in advance.

    Henry

     

  • Re: Unable to cast COM object of type

    07-28-2009, 5:08 AM
    • Contributor
      2,520 point Contributor
    • SSA
    • Member since 05-07-2009, 3:16 PM
    • Amsterdam, The Nederlands
    • Posts 419

    Looking at TYPE_E_CANTLOADLIBRARY, Your server where you placed your website does not have registered OWC11.

    So on your local machine, you have refrenced OWC 11 com component and probably its registered on your machine and its working but on the server, probably you dont have registered office web component (OWC).

    Check on this page OWC component you need on your IIS or production server:

    http://www.microsoft.com/downloads/details.aspx?FamilyId=7287252C-402E-4F72-97A5-E0FD290D4B76&displaylang=en

    Microsoft Office Web Components are a collection of Component Object Model (COM) controls for publishing spreadsheets, charts, and databases to the Web. They are also used to view these items when published and to view data access pages. 

    If you have Microsoft Office FrontPage 2003, Microsoft Office Access 2003, and Microsoft Office Excel 2003 installed, Office Web Components allow you to publish interactive data as part of a Web page. Used with Microsoft Internet Explorer version 5.01 or later, Office Web Components allow you to view a published control (spreadsheet, chart, or database) on a Web page and to view data access pages. 

    By installing the Office Web Components tool, users can view published components and data access pages on the Web without having to install Office 2003. Note: If you do not own an Office 2003 license, the Office Web Components are licensed to be used in static, non-interactive, client-side, view-only mode. If you do own an Office 2003 license, the Office Web Components are licensed to be used in interactive mode.

  • Re: Unable to cast COM object of type

    07-29-2009, 10:32 PM
    • Member
      2 point Member
    • HenryHan
    • Member since 07-08-2008, 1:28 AM
    • Posts 20

    Hi SSA,

    Thanks for your posting.

    Actually, I did download the OWC11.exe and install on the server BUT still with the same error.

    So finally I installed Excel 2003 and everything just work perfectly and the most interesting part is after I uninstall Excel 2003 from the server the system still work as normal without any error.

    Theoretically, by installing the OWC11.exe is sufficient enough to support the system, but just can’t figure out why the above could be happened.

    Anyhow, many thanks.

     

  • Re: Unable to cast COM object of type

    07-30-2009, 4:31 AM
    • Contributor
      2,520 point Contributor
    • SSA
    • Member since 05-07-2009, 3:16 PM
    • Amsterdam, The Nederlands
    • Posts 419

    Perfact, you managed to fix it,

    ya, OWC is enough but may be somehow registry entries were not there correcly till you installed Excel 2003 which fixed it and made com library available.(sometimes rebooting works in this type of case) But for other developer this way can be added as a "Try this way too".

Page 1 of 1 (4 items)