Excel Error: Old format or invalid type library. (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATAREAD))

Add-in Express™ Support Service
That's what is more important than anything else

Excel Error: Old format or invalid type library. (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATAREAD))
 
Omri Suissa


Guest


Hi,
I got an error in one of our computers using office 2007 when trying to get the Excel version in WorkbookBeforeSave event:

Detailed technical information follows:

(Inner Exception)
Date and Time: 20/12/2011 09:54:58
Machine Name:
IP Address: ::1
Current User:

Application Domain: DefaultDomain
Assembly Codebase: file:///C:/Windows/assembly/GAC_MSIL/AddinExpress.MSO.2005/6.5.3057.2005__4416dd98f0861965/AddinExpress.MSO.2005.dll
Assembly Full Name: AddinExpress.MSO.2005, Version=6.5.3057.2005, Culture=neutral, PublicKeyToken=4416dd98f0861965
Assembly Version: 6.5.3057.2005

Exception Source: Microsoft.Office.Interop.Excel
Exception Type: System.Runtime.InteropServices.COMException
Exception Message: Old format or invalid type library. (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATAREAD))
Exception Target Site: get_Version

Stack Trace
Microsoft.Office.Interop.Excel._Application.get_Ver sion()
AddinExpress.MSO.2005.dll: N 00000 (0x0) JIT
ClearMashExcelAddon.AddinModule.adxExcelEvents_WorkbookBeforeSave(sender As Object, e As ADXHostBeforeSaveEventArgs)
AddinModule.cs: line 0180, col 13, IL 0011 (0xB)
AddinExpress.MSO.ADXExcelAppEvents.DoWorkbookBeforeSave(workbook As Object, saveAsUI As Boolean, cancel As Boolean&)
AddinExpress.MSO.2005.dll: N 0018 (0x12) IL

(Outer Exception)
Date and Time: 20/12/2011 09:54:58
Machine Name:
IP Address: ::1
Current User:

Application Domain: DefaultDomain
Assembly Codebase: file:///C:/Windows/assembly/GAC_MSIL/AddinExpress.MSO.2005/6.5.3057.2005__4416dd98f0861965/AddinExpress.MSO.2005.dll
Assembly Full Name: AddinExpress.MSO.2005, Version=6.5.3057.2005, Culture=neutral, PublicKeyToken=4416dd98f0861965
Assembly Version: 6.5.3057.2005

Exception Source:
Exception Type: AddinExpress.MSO.ADXExternalException
Exception Message: An error has occured in the code of the add-in.
Exception Target Site: Object reference not set to an instance of an object.


Can you help me with that?

Omri
Posted 20 Dec, 2011 02:18:06 Top
Andrei Smolin


Add-in Express team


Posts: 18793
Joined: 2006-05-11
Posted 20 Dec, 2011 02:29:11 Top
Omri Suissa


Guest


Hi,
Thanks a lot!

Omri
Posted 20 Dec, 2011 04:24:22 Top
Nicholas Hebb


Guest


I'm scheduled to release my add-in in a few weeks, so I'm glad I discovered this thread. However, with > 40k lines of code, the prospect of implementing this at the method level is daunting. Would there be any drawbacks (e.g., unexpected side effects) to setting the culture only in top level events, then restoring it on the return path?
Posted 20 Dec, 2011 08:06:15 Top
Andrei Smolin


Add-in Express team


Posts: 18793
Joined: 2006-05-11
Hi Nicholas,

You can set the new culture in AddinInitialize.

        OldCulture = System.Threading.Thread.CurrentThread.CurrentCulture
        newCulture = New System.Globalization.CultureInfo( _
            ExcelApp.LanguageSettings.LanguageID(Office.MsoAppLanguageID.msoLanguageIDUI))
        System.Threading.Thread.CurrentThread.CurrentCulture = newCulture


I cannot imagine any problems with this.


Andrei Smolin
Add-in Express Team Leader
Posted 20 Dec, 2011 10:32:21 Top
Nicholas Hebb


Guest


Done. Thanks, Andrei.
Posted 20 Dec, 2011 11:57:03 Top