GenerateTypedBamApi raise TargetInvocationException

Jan 2, 2008 at 1:14 PM
I have the following output while running GenerateTypedBamApi. I have excel 2007 installed on my machine. I tried to run GenerateTypedBamApi against xls (2003 format), xlsx (2007) but result is the same.

GenerateTypedBamApi
Generates a typed C# BAM API from an Excel BAM Definition spreadsheet
Author: Darren Jefford, darrenj@microsoft.com
Version 1.1

Retrieving BAM Definition from the Excel Spreadsheet... Failed

System.Reflection.TargetInvocationException: Exception has been thrown by the ta
rget of an invocation. ---> System.Runtime.InteropServices.COMException (0x80028
018): Old format or invalid type library. (Exception from HRESULT: 0x80028018 (T
YPEEINVDATAREAD))
--- End of inner exception stack trace ---
at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr,
Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[]
namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Bi
nder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers
, CultureInfo culture, String[] namedParams)
at GenerateTypedBAMAPI.Program.GetBAMDefinitionXML(String XLSFileName)
at GenerateTypedBAMAPI.Program.Main(String[] args)
Feb 1, 2008 at 10:44 AM
I have the same problem, and found a MS article explaining the problem here:
http://support.microsoft.com/kb/320369

However when I logged in to Codeplex and tried to checkout the source to GeneratetypedBAMApi and fix it,
I could not see any source files was checked in ..



sashaxp wrote:
I have the following output while running GenerateTypedBamApi. I have excel 2007 installed on my machine. I tried to run GenerateTypedBamApi against xls (2003 format), xlsx (2007) but result is the same.

GenerateTypedBamApi
Generates a typed C# BAM API from an Excel BAM Definition spreadsheet
Author: Darren Jefford, darrenj@microsoft.com
Version 1.1

Retrieving BAM Definition from the Excel Spreadsheet... Failed

System.Reflection.TargetInvocationException: Exception has been thrown by the ta
rget of an invocation. ---> System.Runtime.InteropServices.COMException (0x80028
018): Old format or invalid type library. (Exception from HRESULT: 0x80028018 (T
YPEEINVDATAREAD))
--- End of inner exception stack trace ---
at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr,
Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[]
namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Bi
nder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers
, CultureInfo culture, String[] namedParams)
at GenerateTypedBAMAPI.Program.GetBAMDefinitionXML(String XLSFileName)
at GenerateTypedBAMAPI.Program.Main(String[] args)

Developer
Jul 16, 2008 at 12:17 AM
This has been fixed in the 1.2 release, which also includes source code and other changes and fixes.