• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

Help needed regarding VBA

Joined
1/23/08
Messages
2
Points
11
Hi,
I am a fresh out of college know .Net:smt024 and have been commissioned this task any help would be great. I have a requirement
1)Reading macros from excel file and writing it into an test file
2)Creating an VB.NET or c# equivalent code for the VBA macro
3)Converting it into a C# or VB.NET assembly
4)Calling C# assemblies from Excel VBA and sometimes directly as a formula in the Excel cell.
I am having difficulties trying to figure out where to start and to to go forward as I have no experience with VBA:wall. Any help will be great.
Thanks
Bhuvan
 
I think the thing you need first is Visual Studio Tools for Office http://msdn2.microsoft.com/en-us/office/aa905533.aspx

VBA is basically an older version of VB, so most business logic code will just work.
However, VBA allows you to be very sloppy about the types of variable, so that will bite you at least once.

Also some calculations in C++ or C# will produce radically different numbers from the same expression in VBA. Oh how I loved finding that one out...

Must be said this is exactly the sort of thing that you use a contractor for, not in house staff who've never used this stuff before.
 
Most of the tasks you want to do is trivial. In fact, sample code is all over the internet. There is not a single guide to show everything you need. Just do piece by piece and ask question when you want to do a specific thing. VBA is easier to learn so you can get lot of things done in days.
If you know .NET then the following is the best way to get it working Process.Start("http://www.google.com");
Also some calculations in C++ or C# will produce radically different numbers from the same expression in VBA. Oh how I loved finding that one out...
Care to give some examples, Dominic ?
 
So can any one help me on How to convert an VBA macro to a VB.net that was the second point.
 
convert a specific macro or method to automatically convert any vba macro to vb.net ?

if the macro contains code only, there is little difference when you change to vb. If there is lot of forms, then it's more difficult.

To create Excel function in VBA, here is the steps frice's WebLog : User-Defined Functions in Excel

You would want to create an addin to share the functions among workbooks, though.
 
Back
Top