Need advice to convert VBA app to .Net app

281 views
Skip to first unread message

Ar Bi

unread,
Mar 18, 2015, 10:40:18 AM3/18/15
to exce...@googlegroups.com
Hi. I was asked to convert existed commercial VBA app ( Excel addin .xlam) to .Net app. I'm not a vba developer and I used to work with .net (VB.NET and C#) win forms and web form. During my research I found some references to Excel_DNA. It might be the solution from what I read about that tool.
If someone could help me with the advice what I should do to start from in order to convert VBA Excel .xlam addin into .net. May be I just need to create some .NET addin to call the existed VBA .xlam? If your advice is to use Excel-DNA then if someone can point me to some manual step by step what should be done in order to convert VBA to .NET or make VBA addin to run from .NET using Excel-DNA

Any thoughts/advice will be helpful
And I need some practical advices/manuals and not just use something somewhere.
I need something similar and where it's possible to understand how to convert vba to .net using Excel-DNA (or some other approaches)

Thanks in advance

A

Patrick O'Beirne

unread,
Mar 18, 2015, 10:52:15 AM3/18/15
to exce...@googlegroups.com
I wrote this step by step guide:
http://www.sysmod.com/vba-to-vb.net-xll-add-in-with-excel-dna.pdf

But you'll need to know VBA.

Ar Bi

unread,
Mar 18, 2015, 2:14:28 PM3/18/15
to exce...@googlegroups.com
Thank you.
I will read it.
I used to work with vb6 and vb.net.
I worked with access vba years ago.
I never worked with excel vba.
So, from your experience, Patrick, do you think it will be a challenge for me to follow your guide?

Thanks

A

Govert van Drimmelen

unread,
Mar 18, 2015, 5:05:41 PM3/18/15
to exce...@googlegroups.com
If you just want to get started as quickly as possible, and have a recent Visual Studio version, you can:
* Create a new VB.NET or C# "Library Project"
* Install the "Excel-DNA" package from NuGet (either from the NuGet GUI or by running "Install-Package Excel-DNA" in the Package Manager Console).
* Copy the sample snippet for your language from the Readme.txt file that appears.
* Press F5 and run.

The NuGet package sets everything up, so you don't have to fiddle with the .dna files or anything yourself, and the debugging works too.

To then add a reference to the interop library, which helps with talking to the COM object model, you can install the "Excel-DNA.Interop" NuGet package.

-Govert
Reply all
Reply to author
Forward
0 new messages