Another article on migrating VBA to VSTO
Here’s another article from Microsoft’s Office Developer Center : Convert VBA Code to Visual Basic .NET When Migrating to Visual Studio 2005 Tools for Office .
Why Migrate to Visual Studio 2005 Tools for Office :
- Improved development productivity
- Improved security model
- Easier deployment and versioning
- Added functionality from the Microsoft .NET Framework
- Improved code reuse
- Easier integration
Here’s where I think problems might occur for VBA immigrants :
- different data types (Long, Short, Integer & Co.)
- dates manipulation (.fromOAdate, .toOADate methods)
- no more Option Base (never used it)
What I like :
- Scope of variables : variables can be defined even within a For … Next loop instead of being defined for the whole procedure or function.
- Exception Handling with new statements like “Try … Catch ex As Exception … Finally… End Try” for error trapping.
It doesn’t look like the migration would be too painful. I suppose it’s just a matter of getting used to the object model, the user interface and the error trapping…
hmmm… rephrase : If you manage to get used to the object model, the user interface and the error trapping then the migration should not be painful.
rephrase : I am not a reference. so good luck.