I am a huge fan of the KISS principle (Keep it simple) and a long time VBA for excel user. However all the articles I can find on VBA vs. VSTO (Visual Studio Tools for Office) seem very complicated.
Firstly, I am sick of the very poor IDE built into Excel and I am looking for a new one. VSTO using Visual Studio as the IDE seems to be the only alternative.
So I seek to understand what is the difference between VBA and VSTO to know if it is worth me learning to use VSTO?
Which toolset you use is largely a matter of personal preference, but here are some things to consider:
1. Performance: For most Excel-related tasks VSTO performs very slowly compared to VBA because of the additional Interop layer.
2. UDFs: VSTO does not support UDFs
3. Object Model: Its harder to work with the Excel object model with VSTO than with VBA because there is no .NET Macro recorder to give you hints.
4. IDE: With VSTO you get access to the latest Visual Studio IDE (assuming you have a Visual Studio license)
5. .Net Framework: VSTO gives you access to the very rich and powerful .NET framework
6. Learning curve: VB.NET is a different language to VBA and the .NET framework and object model differences mean that the transition is not as simple as it could be.
7. If you want to go the visual studio/.NET route I would recommend you look at Addin Express or XLDNA rather than VSTO: both of these have less limitations than VSTO
VBA in Excel gives you the advantage of having fast results between editing your code and running your code. Because you are a good VBA programmer, you could live without the super feature from Visual Studio (intellisense, try-catch-fanally, inherits, every .NET objects, multi-threading ...)
VSTO is a way to work inside a very good IDE (Visual Studio), but i am afraid you will waste a lot of time switching between VB.NET and your Excel. It is not as direct as your VBA inside your Excel.
If your main purpose of programming is to stay inside your Excel file, then stay with VBA. If you really need to work outside your excel file or if you want to do something that doesn't necessary depend on your excel files, maybe you could consider VSTO. Beside, VSTO is pretty new and documentation may not be complete.
I would stay with VBA if I were you. THIS IS MY HUMBLE OPINION. I wrote a little comparative between VBA and VB.NET (VSTO): Here's Difference between VB.NET and VBA!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With