Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
TYPE_E_LIBNOTREGISTERED Exception in MS Excel.
Hi All,
I was trying to Automate MS Excel through C#. Everything works fine until in the development machine(it has VS2005 with Excel 2003 in Vista) when I deployed my code in a non-development machine(Excel 2003 with XP) following exception has been thrown. "Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.Excel._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{000208D5-0000-0000-C000-000000000046}' failed due to the following error: Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))." a. I ve already tried Installlating Office 2003 PIA's. b. Repaired Office 2003 also. My Excel references in workspace points to Library in GAC, and "CopyLocal" property has been set to false. any workaround to resolve this would be greatly appreciated. Sample code snippet. Excel._Application m_oApplication; Excel.Workbooks m_oWorkBooks; try-catch // m_oApplication = new Excel.Application(); m_oWorkBooks = (Excel.Workbooks)m_oApplication.Workbooks; |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
TYPE_E_LIBNOTREGISTERED Exception in MS Excel.
It seems that you have a reference missing on that machine from the VBA reference library, on the machine that it works on, in the VBE window choose TOOLSREFERENCES and make a note of all the library objects that are checked (referenced) then make sure the same are checked on the machine that it faults on. Kart;308637 Wrote: Hi All, I was trying to Automate MS Excel through C#. Everything works fine until in the development machine(it has VS2005 with Excel 2003 in Vista) when I deployed my code in a non-development machine(Excel 2003 with XP) following exception has been thrown. "Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.Excel._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{000208D5-0000-0000-C000-000000000046}' failed due to the following error: Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))." a. I ve already tried Installlating Office 2003 PIA's. b. Repaired Office 2003 also. My Excel references in workspace points to Library in GAC, and "CopyLocal" property has been set to false. any workaround to resolve this would be greatly appreciated. Sample code snippet. Excel._Application m_oApplication; Excel.Workbooks m_oWorkBooks; try-catch // m_oApplication = new Excel.Application(); m_oWorkBooks = (Excel.Workbooks)m_oApplication.Workbooks; -- Simon Lloyd Regards, Simon Lloyd 'The Code Cage' (http://www.thecodecage.com) ------------------------------------------------------------------------ Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1 View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=86289 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
TYPE_E_LIBNOTREGISTERED Exception in MS Excel.
Thank u so much for ur reply.. This program was developed in VS2005 in C#.net when i check for the reference i could see only "Excel" and "Microsoft.Office.Core" & these were Excel PIA's (Primary Interop Assemblies). when that gets corrupted how do i proceed. Re-Installing PIA's didn't work. Is there any other workaround like deploying the InteropDLL(Microsoft.Office.Interop.Excel.dll) & reference this dll where it faults. "Simon Lloyd" wrote: It seems that you have a reference missing on that machine from the VBA reference library, on the machine that it works on, in the VBE window choose TOOLSREFERENCES and make a note of all the library objects that are checked (referenced) then make sure the same are checked on the machine that it faults on. Kart;308637 Wrote: Hi All, I was trying to Automate MS Excel through C#. Everything works fine until in the development machine(it has VS2005 with Excel 2003 in Vista) when I deployed my code in a non-development machine(Excel 2003 with XP) following exception has been thrown. "Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.Excel._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{000208D5-0000-0000-C000-000000000046}' failed due to the following error: Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))." a. I ve already tried Installlating Office 2003 PIA's. b. Repaired Office 2003 also. My Excel references in workspace points to Library in GAC, and "CopyLocal" property has been set to false. any workaround to resolve this would be greatly appreciated. Sample code snippet. Excel._Application m_oApplication; Excel.Workbooks m_oWorkBooks; try-catch // m_oApplication = new Excel.Application(); m_oWorkBooks = (Excel.Workbooks)m_oApplication.Workbooks; -- Simon Lloyd Regards, Simon Lloyd 'The Code Cage' (http://www.thecodecage.com) ------------------------------------------------------------------------ Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1 View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=86289 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Exception from HRESULT: 0x800A03EC - COM Exception Unhandled | Excel Programming | |||
exception in excel while writting to it | Excel Programming | |||
exception 0x800A03EC in excel | Excel Programming | |||
Exception report in excel | Excel Worksheet Functions | |||
Excel exception problem | Excel Programming |