Microsoft Visual Basic for Applications for Corporate Developers

Solve Your Application Backlog by Including Visual Basic for Applications in Corporate Solutions

Neil Charney
Microsoft Corporation

September 1999

Summary: Corporate developers can solve many problems by embedding Microsoft Visual Basic® for Applications in their line-of-business applications. (7 printed pages)

With more than 100 third-party applications shipping, developers are well aware of the value of combining Visual Basic for Applications with shrink-wrapped products. Visual Basic for Applications-enabled applications from independent software vendors (ISVs) allow IT departments to adopt a “buy and customize” approach for many solutions. Some requirements, however, are so specific to a particular enterprise that a custom application must be built internally. Central IT departments face the same challenge as ISVs: how to build an application that can be safely extended by departmental developers to meet their specific needs. Corporate IT is pressed to become more entrepreneurial in outlook, viewing internal users as customers. Visual Basic for Applications lets IT make them partners in development as well. I’ll outline some approaches, both technical and organizational, that will enable central IT developers or managers to cope with these challenges and deliver timely solutions to user’s problems.

It seems as if backlog has been with us since computers were invented. PC applications became popular partly in response to the backlog of mainframe development, and now the demand for quality line-of-business Windows applications threatens to overwhelm corporate IT departments. Facing this demand, IT departments often explore development alternatives: more developers, fewer features, longer delivery cycles. None is optimal. Applications that will see broad use throughout an entire enterprise need to implement a common core of features, but they also need to speak directly to the specific needs of individual departments. Without both the broad core and the targeted additional features, users will not buy into, and ultimately benefit from, the delivered application.

Many features of an application will be common to all groups within the company, but the success of the application depends on the portion devoted to department-specific features. Faced with the need to allow departments to customize and extend corporate software, IT organizations had two alternatives, neither of which is desirable. First, they could distribute the application source code to each subsidiary and department that needed to customize it. Second, they could try to incorporate each customization needed into the core application. Distributing the source code has several disadvantages. All departmental developers need the same skill set as the original IT programming team. Multiple, custom versions of the same software make easy upgrades and maintenance releases practically impossible. Incorporating all the needed customizations into the core software addresses these drawbacks but is clearly beyond the capacity of any company that is not primarily a software vendor—which describes most of the corporate world. The challenge for corporate IT departments is to establish a framework that enables departmental developers outside central IT to add custom enhancements without modifying the core software. They must be able to leverage their existing programming resources. The customizations they produce must allow for routine upgrade and support from IS.

Benefitting from Visual Basic for Applications

Faced with the same challenges, ISVs have been offering their customers Visual Basic for Applications-enabled products. A Visual Basic for Applications-enabled application offers a wide range of customization options in a familiar package. The common rules and components that make up the core application are available to departmental developers. Most developers can be immediately productive with Visual Basic for Applications because the Visual Basic language is familiar to more than three million developers. The development environment in Visual Basic for Applications is the same one used in Microsoft Office and the Visual Basic development tool. With version 6.0, Visual Basic for Applications attains full language parity with Visual Basic.

It’s easy to see why a retail product needs Visual Basic for Applications. Independent software vendors (ISVs) can’t anticipate all the uses their customers will find for the application. Shrink-wrapped products are supposed to let the user customize and extend the application. Corporate applications, though, are built for a specific set of users. Visual Basic for Applications aids corporate development in several major ways. Visual Basic for Applications integration lets corporations enjoy the return on new applications sooner because development of department-specific features can be shared. Departmental solution providers closest to the problem can develop narrowly targeted features in parallel. Integration with legacy or third-party applications is also a prime use for Visual Basic for Applications. Finally, having Visual Basic for Applications in a corporate application increases user buy-in and diminishes training time by empowering users to work with tools they understand and customize the application to their style of thinking.

Partners in Development

Business in a world enabled for e-commerce moves faster and demands a quick return on investment. Applications will be obsolete before they can add to the bottom line unless IT finds new methods of delivering features in less time. Most applications consist of a core of standard features and a collection of features narrowly targeting specific user groups. Those narrow features are prime candidates for rapid development.

A feature takes some amount of time to develop. That time is independent of the number of users who will use it. Running narrowly specific features through the corporate programming team may actually increase the time to complete the application. Central IT programmers cannot understand the problem as well as the solution developers in the targeted department. The cycle of building and fixing the same feature until developers get it right is unacceptable. In today’s rapid application development (RAD) environment, they have to get it right the first time.

By implementing these custom features as Visual Basic for Applications projects, IT can cut development time substantially without losing control over the quality of the application. Once the core application is ready and integrated with Visual Basic for Applications, final development of the specialized features can occur in parallel as decentralized solution developers take responsibility for their own features (see Figure 1). The scripts they produce can be sent back to IT to be digitally signed and distributed. Since the final application is ready and accepted by users faster, IT can enjoy the return on its investment for a longer period.

Figure 1. Leveraging Developer Resources: The time to implement a new feature is the same whether it benefits one user or 10,000. With Visual Basic for Applications, you can leverage the resources of departmental solution providers to get your application into the hands of users faster.

No matter how many features end up in the final product, users will want more. Instead of saying “no” to feature requests, developers can offer Visual Basic for Applications as a way to open the application to a broad variety of requirements. The extensions developers add leverage and complement the core application, but are separate from it. IT retains control over the features and quality of the application, leading to a regular upgrade cycle and robust support.

Integration

The days of solving problems with monolithic applications are gone. Almost all real-world systems today are built by harnessing individual applications in ways dictated by a business process. This means integration. Many of the applications you will want to use will be legacy applications. Legacies represent proven code. Often, legacy applications become so entwined with the business that they are irreplaceable. The original source code may even be gone. Visual Basic for Applications gives developers a simple way to leverage Windows and its tools to integrate legacy applications into new solutions. Even if a new system is built entirely from new applications, integration is important. Many ISVs are building Visual Basic for Applications into their products. These products are tools developers will want to use because they provide ready to use features. With Visual Basic for Applications on both ends, integration is simplified. In fact, the same developers can perform the integration task in both applications, greatly reducing the chances of bugs stemming from integration.

This is the approach Microsoft Office took. Visual Basic for Applications is the unifying integration technology that ties the suite together and makes it a popular framework for departmental solutions. A corporate application that uses Visual Basic for Applications can build on this framework. The strengths of each member of the suite are equally accessible from all applications that use Visual Basic for Applications. Developers can write integration scripts in any of the applications using a common language to merge the various applications into a coordinated solution. With Visual Basic for Applications in place, IT can leverage Microsoft Office in partnership with their internal applications for many problems.

If a legacy application includes some distributed technology like DCOM or sockets, integration is easy. Usually, though, developers aren’t that lucky. Legacy integration then becomes a matter of using the tools Windows provides to connect a new application to the legacy application through data. The characteristics of the legacy application will determine what tools can be used to perform the integration. Whether simple tools like COM and shared files are used (see Figure 2), or more sophisticated techniques like message queuing, Visual Basic for Applications will help. Visual Basic for Applications is built to take advantage of all the tools Windows offers. Virtually all the tools a developer might use to perform integration expose a COM interface, so Visual Basic for Applications programmers are halfway to learning the integration technique when they start. Visual Basic for Applications lets them concentrate on connecting applications, not learning APIs for the tools that connect the applications.

Figure 2. Legacy Integration Techniques: An effective way to open a legacy application to new uses is to use a COM wrapper to hide the proprietary API of the legacy application. An even simpler technique accessible to most legacy apps is shared files or databases. Both techniques are easy to access from Visual Basic for Applications.

Most ISVs include a programmable COM interface to their applications when they add Visual Basic for Applications. In theory, then, solution developers could simply write new applications to take advantage of the programmable interface directly and avoid Visual Basic for Applications. In practice, however, applications will extend their object model over time, and requirements for pre- and post-processing data during integration will change. With Visual Basic for Applications in both applications, integration “glue” can be changed as easily as changing a script. Because the same tool is used in both applications, developers are free to move integration code between the two applications to optimize performance or better organize the code base.

Integrating Visual Basic for Applications: Easier Than Ever

The requirements for getting these benefits are rather small. The costs of using Visual Basic for Applications have always been lower than the costs of adding all the features and performing all the customizations with a central development team. Even better, Visual Basic for Applications 6.0 and its SDK add several new features to make it easier than ever to add Visual Basic for Applications to an application.

Visual Basic for Applications 6.0 introduces the Application Programmability Component (APC), a COM object with an Automation interface that wraps the Visual Basic for Applications API. Now Visual Basic for Applications integration is as easy as adding database access components or any other set of Windows services. The APC object model gives the application programmer full access to the language engine and the IDE.

The tool support goes even further. The Visual Basic 6.0 SDK includes an Integration Wizard, which automatically integrates Visual Basic for Applications with any Visual Basic 6.0 project. The Wizard furnishes all the code required for a basic integration and adds entry points for customizing how Visual Basic for Applications projects are saved by your application. There are many models for saving Visual Basic for Applications project code. Some applications, including Microsoft Office, save Visual Basic for Applications projects in the same file the main application uses to store its own data. Others keep the two separate, saving Visual Basic for Applications projects in a different file. The code the Integration Wizard creates handles all the tasks needed to put a Visual Basic for Applications project into structured storage. Developers can use this code as a black box and fit it their file-handling code in whatever way makes the most sense for their applications.

The Integration Wizard also gets developers started on creating an application object model by creating the global application object. It is possible to stop there, but to fully realize the benefits of Visual Basic for Applications, an application should add other objects. This makes it easy for users and solution developers to leverage the features of the core application to create their own solutions. This is the path Office and other Visual Basic for Applications-enabled applications have chosen. It is the key to providing developers access to the features of the application without exposing the source code to uncontrolled modification.

If a developer is enhancing a Visual Basic project that didn’t start with class modules, she needn’t throw out proven code. She can design an object model and create new class modules. These modules can be implemented as wrappers for existing functionality. This gives developers the best of both worlds: an object model based on existing, proven code.

The Visual Basic for Applications 6.0 SDK also provides tools specifically for C++ developers. Frameworks are an important part of Visual C++® development, so the APC includes classes that are compatible with the Microsoft Foundation Classes (MFC) and the ActiveX® Template Library (ATL), the most popular frameworks for application development using Visual C++. APC lets programmers integrate Visual Basic for Applications with their applications using the techniques, tools, and libraries they already use to build those applications.

No matter what development tool IT uses to create the core application, the Visual Basic for Applications 6.0 SDK provides tools and documentation that makes it easier than ever to add Visual Basic for Applications as the technology for creating customized solutions.

Completing the Circle

Corporate IT programmers are crucial to Visual Basic for Applications development. They develop the basic features all applications in the company use. These are the kinds of things that cut across all departments. They are the rules by which you do business and the innovations that distinguish your company. Your programmers provide them as a foundation on which departmental solutions are built. They ensure data and process are consistent throughout the company.

Standards and quality control are an important part of the corporate IT mission. It is important to improve the quality and consistency of software because businesses increasingly rely on software to do business. A flaw can mean lost productivity, diminished profits, and costly liability. The Y2K issue is a prominent example. Corporate programmers will increasingly shift their role from doing all development to facilitating and supporting development by solution developers close to the operating units.

Visual Basic has been an important part of corporate development for some years now. As both a programming language and a RAD tool, Visual Basic has been the most successful tool for delivering a line-of-business applications. Millions of developers are familiar with the language. ISVs have learned that Visual Basic for Applications is a great way to extend the benefits of Visual Basic to their users. Corporate IT can borrow a lesson from successful ISVs and make Visual Basic for Applications a tool for meeting their software development challenges. A partnership between IT and departmental developers enabled by Visual Basic for Applications can solve pressing needs in the delivery of effective corporate solutions.