Purpose: To bubble up events from C# DLL to EXCEL VBA. I have created a COM
wrapper that uses other assemblies and runs a background thread to listen to
events & fire it up to the COM layer using COM sink interface.
Creation of TLB file and referencing it in the Excel VBA all works fine.
While Opening the Excel I load all events and this works fine.But when the
excel is kept open and events are fired later on from the C# layer an
exception is thrown as shown below.
Simply same code works fine but after a while it does not work. So weird.
Any help is greatly appreciated.
Environment:.NET Version 2.0, Excel 2003 SP2 (11.8105.8107), XP Professional
Version 2002 SP2, VS2005 version 8.0.5072751
Object does not match target type. 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, Binder binder, Object target, Object[] providedArgs,
ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at System.RuntimeType.ForwardCallToInvokeMember(Strin g memberName,
BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&
msgData)
at SusExVBAInterface.VBAEvents.SusExExecutions(String sUserId, String
sSymbol, String sOrderSide, Double dblQuantity, Double dblPrice, String
sAccount, String sRouteId)
at
SusExVBAInterface.SusExVBAWrapperNew.SusExEventsSe rver_SignalSusExVBAEvents(String
UserId, String Symbol, String OrderSide, Double Quantity, Double Price,
String account, String RouteId) in
P:\SusExVBAInterface\SusExVBAWrapperNew.cs:line 134
For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
A quick search on google revealed me that lot of people are facing this
problem but there is no solution to it. Here are the links.
search keyword: Object does not match target type
http://groups.google.ie/group/micros...8561ef77ad2111 http://groups.google.ie/group/micros...350c216e3009d6 http://groups.google.ie/group/micros...e47517ac689400
Any help is greatly appreciated.
Thanks,
Senthilnathan