3

Possible Duplicate:
Is it possible to convert VBA to C#?

Suppose I have a big VBA project and want to convert it to a .NET language. Is there any way to do it automatically? Or maybe could I generate UML and a class structure, then append method bodies by hand?

Community
  • 1
  • 1
idm
  • 1,728
  • 2
  • 19
  • 26
  • 1
    No, [not possible](http://stackoverflow.com/questions/388819/is-it-possible-to-convert-vba-to-c). – Uwe Keim Nov 22 '11 at 14:46
  • 1
    Probably more effective use of time recoding the bits of VBA into a new project. Keep things simple by sticking with VB .Net, but you'll find yourself replacing the ugly parts often enough to justify recoding. – William Stearns Nov 22 '11 at 14:51
  • Sorry, this is access forms project and I want any tool (preferably free) to convert it to a .net (C# or VB, doesn't matter) project. I'd also appreciate any ideas on generating UML from VBA. – idm Nov 22 '11 at 15:04

1 Answers1

4

I don't think there's a provided way to migrate VBA to .NET, but there are conversion tools online that might help as a syntactical reference for parts of the code. This approach will be cumbersome, but it might still be easier than doing it all by hand.

Here's an article that discusses migrating VBA to VB.NET:
http://msdn.microsoft.com/en-us/library/aa192490%28v=office.11%29.aspx

Converters

Here's a VB.NET to C# converter:
http://www.developerfusion.com/tools/convert/vb-to-csharp/

And here's another one:
http://converter.telerik.com/

I don't know how helpful the converters will be since they're designed to convert .NET languages to other .NET languages, but seeing as how VBA and VB.NET do share some similarities, you might be able to use the converter for some of the code.

James Johnson
  • 45,496
  • 8
  • 73
  • 110