Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

VBA and Managed Code Extensions Compared

Microsoft Visual Basic for Applications (VBA) uses unmanaged code that is tightly integrated with Office applications. Managed code extensions in Microsoft Visual Studio 2005 Tools for the Microsoft Office System projects enable you to take advantage of the .NET Framework 2.0 and Visual Studio design tools.

Comparison

The following table provides a basic comparison between VBA and managed code extensions.

Visual Basic for Applications Managed Code Extensions

Uses code that is connected to and persisted with the document.

Code is stored separately from the document.

Works with the Office object models and Visual Basic for Applications APIs.

Works with the Office object models and the .NET Framework APIs.

Designed for macro recording and a simplified developer experience.

Designed for security, easier code maintenance, and the ability to use the full Visual Studio integrated development environment (IDE).

Works well for solutions that benefit from a very tight integration with Office applications (IDE, menus, toolbar buttons, and so on).

Works well for solutions based on Word documents and Excel workbooks, where the full resources of Visual Studio and the .NET Framework can be used.

Has limitations for the enterprise, especially in the areas of security and deployment.

Designed for use in the enterprise.

Some things are still easier to do quickly using VBA. Specifically, you might want to continue using VBA for:

  • Custom worksheet functions.

  • Macro recording.

See Also

Community Additions

ADD
Show:
© 2015 Microsoft