Sunday, July 26, 2009

Is there any hope to convert the VB i coded in MS Excel to C# .NET?

Please help me... I am not good in C# but I am (no so) expert in Visual basic... what is the easiest thing to do?? I need an application that uses C# (express ed 2005). I like C# becasue of its features... i am using only VB6 that is added with ms excel lib ref.

Is there any hope to convert the VB i coded in MS Excel to C# .NET?
As you already know VBA and VB.NET are quite a bit different, but at least they are closer than VBA and C#. You can use an online convertor that converts VB.NET code in C#.NET code. This will look pretty rough if you put the raw VBA code into the convertor.





My suggestion is to convert the VBA code to C#.NET using the online convertor, then add a Reference to the Excel library in .NET, and finally change all of the Excel objects to their respective .NET compatible types (ex. Range -%26gt; Excel.Range).





The online convertor is linked below.
Reply:The short answer is "yes". All the things you want to do in VBA (Visual basic for applications) can be done in .Net.





If you used VB, its even easier, and you might want to consider using VB.net.


No comments:

Post a Comment