VBA to C# Add-in

Tutorial Navigation | Next: Part 1: Overview of the VBA Utility

This tutorial covers the process of converting a simple ArcMap 9 VBA utility to an ESRI Add-in for ArcMap 10 using Visual Studio C# 2008 Express.

The target audience is ArcGIS users that have VBA code they want to convert, but have little or no experience with Add-Ins, Visual Studio, or the C# language.


There is a free 60 minute recording available of the ESRI online seminar, Developing Add-ins for ArcGIS Desktop 10. It is an excellent way to get familiar with the overall concepts and procedures.

The ESRI webite has the most complete information for ArcObjects development:
ArcObjects Help for .NET developers
ArcObjects API Reference

The ESRI ArcObjects forum is a good place to search for answers and ask questions:
ArcObjects Forum

Some Background

ESRI deprecated support for Visual Basic for Applications (VBA) in ArcGIS 10, and recently officially announced dropping support for VBA altogether in the upcoming ArcGIS 10.1. What this means is, that in the near future, countless VBA utilities created by the ArcGIS community and in-house in organizations will be rendered unusable in ArcGIS.

It is important to understand what VBA was used for in ArcGIS. Geoprocessing operations have a wealth of built-in tools, and both ModelBuilder and scripting capabilities are available to create utilities that operate on layers and data. But, in order to extend the user interface — and most importantly to work with the objects in the interface such as layout elements — programming against the ArcObjects API is necessary.

There have long been methods other than VBA available for extending the ArcGIS user interface tools via extensions created with languages such as C++ and Java using the ESRI ArcObjects SDK. However, these require a significant level of programming experience and come with installation complexities. The best part of VBA is its easy language and tight integration within the ArcGIS applications. To fill the void left by the exit of VBA, ESRI introduced a new Add-in architecture in version 10. Add-ins greatly simplify the creation and installation of customizations. One can use the free Express edition of Microsoft’s Visual Studio and any of its supported languages (C#, VB.NET, C++) or the open source Java Eclipse IDE. The ArcObjects SDK installer installs wizards, templates, help, and code snippets into the development environments to aid in creating and deploying Add-ins.

Tutorial Navigation | Next: Part 1: Overview of the VBA Utility

  1. #1 by Darcy Thomas on February 7, 2012 - 11:47 am

    Outstanding and very thorough tutorial. Thank you,

(will not be published)