HighTechTalks DotNet Forums  

VBA & .NET Com Interop(Events give Type-Mismatch Error) -v Interes

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


Discuss VBA & .NET Com Interop(Events give Type-Mismatch Error) -v Interes in the Dotnet Framework (Interop) forum.



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

Default VBA & .NET Com Interop(Events give Type-Mismatch Error) -v Interes - 07-02-2009 , 12:32 PM






Hi,

I have a very interesting problem

Basically i have made a COM Dll in VB.Net (.Net 2.0) so that it can
interact with my existing Excel VBA Code.
I have used ComSourceInterfaces to basically source a single Event back to
my VBA Code.

Note that the delegate has 3 parameters in total of which 1 is a Arrray of
custom type declared in my DLL and One is a simple String and One is a
System.Exception type.

The problem is if i declare the class as withevents and then raiseevent
it gives an error saying type mismatch..

It does not even raise that event and fails on the line RaiseEvent inside
the .Net Dll

My Analysis
I think the problem is that Excel VBA , when is is sourcing events is not
able to "see" the custom parameters..

Any one have a work around for this?

Regds
Shrey

Reply With Quote
  #2  
Old   
shrey
 
Posts: n/a

Default RE: VBA & .NET Com Interop(Events give Type-Mismatch Error) -v Interes - 07-03-2009 , 02:55 AM






Ok I can confirm that the events work if they are simple type...or even a
custom type

they do NOT work if it has of type sytem.exception , or if it an array


"shrey" wrote:

Quote:
Hi,

I have a very interesting problem

Basically i have made a COM Dll in VB.Net (.Net 2.0) so that it can
interact with my existing Excel VBA Code.
I have used ComSourceInterfaces to basically source a single Event back to
my VBA Code.

Note that the delegate has 3 parameters in total of which 1 is a Arrray of
custom type declared in my DLL and One is a simple String and One is a
System.Exception type.

The problem is if i declare the class as withevents and then raiseevent
it gives an error saying type mismatch..

It does not even raise that event and fails on the line RaiseEvent inside
the .Net Dll

My Analysis
I think the problem is that Excel VBA , when is is sourcing events is not
able to "see" the custom parameters..

Any one have a work around for this?

Regds
Shrey



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 - 2010, Jelsoft Enterprises Ltd.