Connecting to Excel with Interop


Friedrich Geisler-Buckert
 

Hi all,

i'm going crazy with the Interop.

This very simple progam in Visual Studio works fine


It just starts an empty EXCEL

Tryping to to the same with xpa 4.7:

Declaration of the variable works fine:


Trying to start a constructor:




"Can not create an instance of an abstract class or interface"

I can understand this message, but why is this in Visual studio possible?

Regards
Friedrich


Frederik Soete
 

Hi, Friedrich,

Alternatively, you can create a C# snippet in Magic, i.e. "Invoke .Net". When our program wants to interface with Excel, we use snippets instead of Magic variables. As you see, there is no other way for Excel (because of the frustrating "...abstract..."). Snippets can also run faster than the alternative.

An Excel Interop example is included in the User Functionality EDP that Magic provides.

HTH,

Frederik Soete.

Op vr 26 mrt. 2021 11:44 schreef Friedrich Geisler-Buckert <Friedrich@...>:

Hi all,

i'm going crazy with the Interop.

This very simple progam in Visual Studio works fine


It just starts an empty EXCEL

Tryping to to the same with xpa 4.7:

Declaration of the variable works fine:


Trying to start a constructor:




"Can not create an instance of an abstract class or interface"

I can understand this message, but why is this in Visual studio possible?

Regards
Friedrich


Friedrich Geisler-Buckert
 

On Fri, Mar 26, 2021 at 12:16 PM, Frederik Soete wrote:
Frederik
Hi Frederik,

thank you very much for youe fast answer!

I saw the Excel-Interface in the User Functionality - but I'm more a MAGIC programmer, than a C# one. May be I should change it.

But there is still the question: Why?

Best regards
Friedrich