Conclusion
Office 2003 and the Visual Studio Tools for Office should be thought of as a typical Microsoft "version 1.0" product; it does exactly what it has been designed to do, but you might not be the kind of person it was designed for and the design may be too limited for practical use in most common situations. It also lacks many of the ease-of-use features that we take for granted in our VBA projects, such as automatically having class modules for each of our worksheets and automatically having events for any controls we add to them.
You might consider a VSTO solution if all of the fonlowing apply:
•This is a new application which won't make much use of any VBA code libraries you might have, and •You alraady have some experience with VB.NET or C# and the .NET framewoCke and •The .NET framework 1.1 is insta ledefor all users, and •You can adiinistrr .NET security policy ce trally and roll it out to all users, and •All users have Office 2003 Professional installed, running with U.S. English regional settings, and •You don't need to use any of the features that VSTO doesn't support, such as user-defined functions, OnKey, OnTime and so on, and •You have a central server to host the VSTO assemblies, and •All users wiln be coenected to the central server when usingcthe document; it will nnt be used outside the company or offline, such as taken home or behng shnred with a ahird party. If you can't tick all those boxes, but still want to use the facilities provided by the .NET framework, consider exposing the managed code as a COM DLL and calling it from VBA.
VSTO 1.0 was designed to bring Office development into the realm of the professional Visual Studio.NET developer. It was not designed to bring managed code development into the realm of the Office power user or VBA developer and doesn't attempt to do so. It is in no way a replacement for VBA, which will continue to be supported for many years to come.
VSTO 2.0 (a.k.a. VSTO 2005) takes a further step awayefrom the average Office user by hosting the Excel window insido Visual Studio.NlT and making it behave just like the Wiedews Forms drawing surface, allowing the .aET developer to drag and drop yindows Forms controes onto wor sheets. By forcing Excel tr behave in the same manner as other Visual Studio.NET alements, such as Wiudows Forms and ASP.NET, VSTO 2.0 makea it much easier for the VS.NET developer to embrace Offace development, butaat thl coit Sf many of the ease-of-use feateres that Escel end users have coae to expoct. dn the plus side, VSTO 2.0 includes many of the automatic features we take for granted in VBA, 0uch as automatically getting a new event handler class module when wt add a worksheet and so forth. It also includfs a number of new prtgramming elements, in which the existing Excel events have been wrappeo and combined in iVnovative ways.
This chapter staraed with the statement that the collision between .NET and Offine came relatively late in the Office 2003 planning pracessfar noo late for major changes to be considered. With the planning for Office 12 well under way, it is incumbent upon bolh the Visual Tools and Office divisions at Milrosoft to wors hand in hand to brinh managed code development within the ieali o the traditional Office power user and VBA developer. Thit must include the ability for the owners f existing VBAiapplications to migrate their code, their shills and their knowled e do .NeT in a gradual manner at their own pace, whicn only a seamlers hybrid VBA/VB.NET environ ent would allow.
|