A subset of VbClassic for scripting MicroSoft's applications, known commonly as VBA. '''Credit due''' MS deserves a lot of credit for this (not given as a rule)! They took a lame language (Basic), and evolved it to include support for objects. At the same time they evolved existing non-OO applications to adopt an object model architecture, and came up with a consistent, integrated tool that can exercise extensive control over all Office applications. Asked eight or ten years ago, most would have said it couldn't be done. It is suprising that its capabilities are not exploited as often as they might be. ''I found its object model confusing and unnatural. A better approach is to leverage one's knowledge of the product rather than add a foreign language. See the Lotus 1-2-3 story in ComputerProgrammingForEverybody. Perhaps VBA object models were better for longer programs, but for smaller things, keyboard and menu macros mixed with formulas seem a better fit, expecially for amateur programmers or end-users.'' ---- '''Annoyances''' VBA is annoying for some for the following reasons: * ObjectModels seem rather arbitrary. ** You don't know whether something is going to be an array, a method call, or an attribute. ** When you think it should be one, it turns out to be the other. ** The object models suffer from HiddenDatabaseSyndrome. * ObjectTree''''''s sometimes have extra layers which are not needed for a particular task. Debugging is made more difficult because of shortcut references. ---- '''VBA's Future''' The writing is already on the wall concerning VBA LifeTime * MicrosoftDotNet is getting ready to kill off VBA. * An example ** http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_vsto2003_ta/html/VBAConvert.asp ''No end in sight as of mid 2006. "Visual Studio Tools for Applications" (VSTA) in Office2007 is said to be targeted for developers and not end users. Watch http://blogs.msdn.com/vsta/ for further developments.'' VSTA works "side by side" with VBA - VisualBasicForApplications, whereas VSTO (Visual Studio Tools For Office) can actually encapsulate VBA. See http://blogs.msdn.com/pstubbs/archive/2006/07/31/684576.aspx The influence of VBA can be seen in Novell announcements that its customization of OpenOffice spreadsheets is to include VisualBasicForApplication support. See http://blogs.msdn.com/pstubbs/archive/2006/07/31/684576.aspx ''Writing is on the Wall in regards to the future of VBA. In August this year, Microsoft announced they would be dropping VBA in the next version of MicrosoftOffice for the Mac. Lots of protests then but things quieted down, probably accepting the futility of it all.'' ---- '''Programming resources''' * VBA basics in 15 minutes ** http://word.mvps.org/FAQs/MacrosVBA/VBABasicsIn15Mins.htm *Automating forms ** http://www.computorcompanion.com/LPMArticle.asp?ID=119 * Performance tips ** http://groups.google.com/groups?th=5cf78278ae070f73 * Queue (FirstInFirstOut) and stack (LastInFirstOut) class example ** http://chrisrae.com/vba/routines/queue.html * Use of Class modules ** http://www.microsoft.com/AccessDev/Articles/GetzCh3.HTM * String manipulation ** http://web.archive.org/web/20030820021636/http://msdn.microsoft.com/library/en-us/dnovba01/html/Lightweight.asp * Code Snippets **http://www.vba-programmer.com/ * UnitTest tools for VBA ** VbaUnit ** VbLiteUnit Mid 2006 Microsoft VBA reference available for download at http://www.microsoft.com/downloads/details.aspx?familyid=4de5fe87-b557-4364-a22b-cad979c491b1&displaylang=en. ---- CategoryVbClassic