![]()
November 24, 1997
By Don Kiely
Part 2 of 2
The VBA host products released to date include both general-purpose and industry-specific software. Visio Corp. had the first non-Microsoft VBA products on the market with its popular graphics design tools, providing automatio
n for custom shapes and a link to Office applications for report generation and analysis of design objects.
Systems Modeling Corp. has released its Arena manufacturing and system modeling software with VBA, letting users model complex processes and control the simulated flow of material through a plant.
TanData Corp.'s Progistics provides tools and applications to embed shipping and transportation features in applications for customization and integration with other VBA apps.
OSI Software Inc.'s PI System is a plant-information-management system for use at process manufacturing plants for real-time control of the manufacturing system, allowing management of huge databases of historical operating and system data.
And Seagate Software integrates VBA into Crystal Info to allow custom reporting functions.
With each of these products, users can create procedures that enhance the specific use of the software as well as create entire standalone, general applications hosted by the software, si
nce the full VBA language and tools are integrated within the product. With a properly designed application and object model for manipulation in VBA, what was once a static, limited application becomes a powerful tool that a user can customize and developers can use to build complete custom applications that integrate with other Windows applications.
Microsoft and its licensing partners paint some compelling reasons for licensing VBA as a scripting language. The primary reason is that the package includes a complete set of design and debugging tools, allowing your application's users to develop their own custom applications based on your tools. The Microsoft tools include the full VBA language engine; Visual Basic Editor, with its project- and code-management features; Microsoft Forms; object browser; and debugging tools. (See Part 1 of this story, "
Visual Basic App Edition Eases Code Reuse
.") Microsoft has also announced that VBA licensees can license the Microsoft Repos
itory, used for support and deployment of software components, at no additional charge.
Another reason to use VBA: Users will be able to use tools they are already familiar with to develop custom applications. That's because VBA is used in Microsoft Office and more than 100 other applications in many industries. This is no small matter. When I'm beginning a new project for a client and evaluating the tools I'll use to create the solution, I tend to use familiar tools if
I can meet the requirements of the application. It further simplifies development if the client already uses VBA host applications. All I have to do is create an interface, manipulate the objects in the host applications, and focus on the custom features the customer needs.
Microsoft claims that 3 million developers create Visual Basic applications, providing a rather large potential market for your development environment. These developers will already be familiar with the basics of how your object hierarchy works, since to integrate
VBA you have to create an object model similar to that in other VBA products.
Your objects, their relationships, and what they do will likely be quite different, but a VBA developer will already know how to manipulate the objects, set their properties, call their methods, and access members of collections.
Microsoft has had great success catering to the needs of software developers. In this age of specialization, VBA lets you focus on what you do best and leave the development of a scripting language to someone else.
The already large number of VBA developers is growing every day, as additional products that integrate VBA arrive on the market. As VBA developers use more of these applications and casual users explore the VBA design tools to customize their applications, a whole support industry has developed. Thousands of books, magazines, training seminars, and trade shows support your VBA host application, even though they don't mention it by name.
So why might you not want to license this
scripting language? VBA is a Windows-only solution, though Microsoft says it will make the language available on other platforms. It's likely to appear on the Macintosh, since Microsoft reaffirmed its commitment to that market with its investment in Apple, but I'd be surprised if it appeared anywhere else.
In addition, you have to make your application conform to the VBA way of doing things, such as designing the object model, which is the foundation for VBA code. This has the benefit of standardization, but it may limit what your application can do. This is less of a problem for programs you design from scratch to use VBA. But retrofitting VBA into an existing application could be a nightmare.
Another reason to avoid VBA is because its large, complicated API requires skills similar to those needed to program Windows itself at a low level. Microsoft's licensing agents have tools to ease the process, but you'll still have plenty of coding to do. Using VBA or any scripting engine is not a decision to
be taken lightly. I'm not sure that simple utilities can benefit from VBA, but most comprehensive analysis tools probably could.
Licensing Agents
To start your evaluation of VBA and the two l
icensing agents, visit each of their Web sites and jump through the hoops to obtain the evaluation copy of VBA and the integration tools they make available. You'll have to fill out a form with contact information and some preliminary information about you, your company, and how you might use VBA, then sign an evaluation agreement. Once you've faxed in the agreement, each licensing agent responds with information about downloading the evaluation kits.
Both Mystic River and Summit have tools for developing VBA-licensed applications using C++, particularly Microsoft Foundation Classes, but there the similarity ends. Mystic River bundles its tools in its Power Pack 3. Mystic's VBA Accelerator Class Library (VBXL) is an object-oriented class library that provides a programming layer over the VBA API, much the same way that MFC streamlines Windows programming. The class library supports all of VBA's features either through its own function calls or through direct access to the VBA API, giving you the flexibili
ty to use whichever method is more effective.
The Mystic Application Wizard steps you through the process of creating a VBA-enabled host application. The wizard is integrated into Microsoft Developer Studio and functions much like MFC's AppWizard, providing shell code for VBA's features, including setting up the VB integrated development environment that a developer uses when creating custom applications using the host application. AXCC, Mystic's VBA-enabled ActiveX Control Container, provides container classes for hosting and scripting ActiveX controls.
The Power Pack includes five sample applications to show how to use VBA in different types of applications, such as MFC multiple- and single-document interface applications and non-MFC applications. Also included is an example of using VBA persistence with data-access objects.
The documentation covers the VBXL API, a guide to integrating VA using VBXL, and an Extensions Cookbook showing how your host application can use and extend VBA's features
.
Summit Software also provides a basic set of tools for integrating VBA into MFC applications. Its Summit VBA Framework for MFC (VBFX) uses classes (see diagram above) derived from MFC classes to provide a simpler interface to the VBA API. This approach takes advantage of the features already built into MFC for managing documents and views, OLE, and OLE controls.
Summit has opened up VBA for integration into Visual Basic applications with its VBA Access Objects (VAOs) 1.0 ActiveX component. VB has the same problem with the VBA API that it has with much of the Windows API. Even with the new AddressOf operator in VBA 5.0, VB can't call many of the API functions that require callbacks, specialized COM interfaces, and access to the Windows message loop. But with the VAOs, you manage and respond to the VBA engine in the same way that you manipulate any kind of object in a VB application.
Which Do You Choose?
Integrating VBA into applications has plenty of benefits, with a few potential pitfalls, but it will require some serious development work on your part. Microsoft and its licensing partners provide plenty of support both for your initial decision and for the actual work of integrating VBA. But using VBA can garner plenty of attention your application wouldn't otherwise get from developers and users alike.
Don Kiely is the director of technology for SkyF
ire Group, developing Windows and Internet applications. He can be reached at
donkiely@computer.org
.
ince Microsoft announced in June 1996 that it would begin licensing its Visual Basic Application Edition (VBA) to independent developers, more than 100 companies have signed up to produce some 200 VBA host applications. Besides helping to make Microsoft's own VBA products the standard in development tools, independent developers can ride the same wave of popularity as more people become familiar with programming VBA. Any reasonably complex application that can benefit from user-designed automation, customization, and integration with other applications is a candidate for VBA scripting.
Microsoft has engaged the services of two licensing agents for VBA, Summit Software Co. and Mystic River Software Inc. Using two agents, both with extensive experience integrating scripting engines into applications, was a smart move by Microsoft. Because these agents get a cut of the licensing fees for agreements they make, each has a vested interest in marketing VBA aggressively. Each company develops its own tools for easing the chore of integrating VBA into your applications, so you can pick between products that best suit your application and development platform. But since Microsoft is the ultimate licensing entity, I doubt you'll get any better licensing terms by going with one or the other, although Summit claims to have an inside track because of its close relationship to people at Microsoft.
The best part of the tools available from Mystic River and Summit is that they ar
e included with the cost of licensing VBA. These companies make a licensing fee from the money you pay Microsoft; they in turn provide these integration tools as well as handle VBA technical support. So the choice of which licensing agent to use depends on who has the tools best suited to the kind of application you are developing and your confidence in each company's ability to provide you with technical support. I have found both companies to be quite responsive in my limited dealings with them, providing timely information when I've asked for it.