HighTechTalks DotNet Forums  

Exception Raising Events from C# DLL (COM Event Source) to Excel V

Dotnet Framework (Interop) microsoft.public.dotnet.framework.interop


Discuss Exception Raising Events from C# DLL (COM Event Source) to Excel V in the Dotnet Framework (Interop) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Senthil
 
Posts: n/a

Default Exception Raising Events from C# DLL (COM Event Source) to Excel V - 05-16-2007 , 12:43 PM






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


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.