17 October, 2007

Converting VBA code to .Net

My latest torture assignment is to convert legacy VBA code in ArcView applications to the .NET Framework. I haven't decided yet if I will convert them to VB .NET or C#, but since I like the C# language better, I will probably attempt to convert them to C#. But then, that somewhat depends on ArcView and how it handles these things. I haven't much (any) experience with ArcView so this is all new territory to me.

I did find a couple of somewhat useful links regarding converting VBA to .NET:

Converting Code from VBA to Visual Basic .NET

Convert VBA to VB .Net and C#

I found this VBA script which purports to export VBA modules, class modules and forms associated with an ArcView document to a separate folder. I haven't tried it yet as I won't get ArcView loaded until tomorrow. But I'm certainly going to give it a go. Anything to make things easier!

Export VBA Code

Okay, I don't know if the module will work at any rate because we can't compile the ArcView project here. I tapped another developer who actually has ArcView on her machine and we were going to run this module, but the guy who created this project has referenced some Autodesk stuff, which we don't have. So we have to export the modules,classes and forms one at a time. There are quite a few of them there.

I'll keep you posted on what entails with converting the VBA to C# code as this endeavor progresses.

4 comments:

Englestone said...

I'm just amazed that no-one has written a straight VBA to VB.NET or C# windows application.

People have spent far more time on much more useless endeavors.

-- Lee

Santosh said...

Hey man,

Well vba to c# is what i am working on but more time needed coz i am not very good at vba

I work on arcgis, (arcobjects)

will post solutions very soon...

PURNA MAGUM said...

Hi,

Am a ASP.NET developer. I got a requirement that to export data to excel sheet using VBA...
But I dont know VBA. Do we have any links to convert C#.Net code to VBA.

That helps me alot.

Thanks in advance.

Purna

Unknown said...

Sorry, Purna, this post was written nearly 4 years ago, and I barely remember what I worked on last month. Nothing in those links could help you?