Office 2013 and later

Last modified: March 09, 2015

Applies to: Office 2013 | Visio 2013

In this article
Example 1
Example 2
Example 3
Example 4

Executes an add-on or a macro in a Microsoft Visual Basic for Applications (VBA) project.





Data Type





The name of an add-on in the Addons collection or a macro in a VBA project.

If the project of the document that contains the RUNADDON function call (or another project if it is referenced) does not have a macro (a procedure with no arguments) named string, Microsoft Visio runs the add-on named string. If no add-on named string can be found, Visio does nothing and reports no error. (You can use the TraceFlags property to monitor the procedures and add-ons that Visio attempts to run.)

When you call a procedure in a standard module, it is recommended that you prefix the string with the module name that contains the procedure (for example, moduleName.procName), because more than one module can have a procedure with the same name.

To call a procedure in a project other than the project of the document that contains the RUNADDON function call, use the syntax projName.modName.procName (you must have explicitly set a reference to projName in your VBA project).

Note Note

Beginning with Visio 2002, the RUNADDON function cannot execute a string containing arbitrary VBA code. Code that was formerly passed to the RUNADDON function can be moved to a procedure in a document's VBA project that is called from the RUNADDON function.

For more information about running code in Visio, see About Security Settings and Running Code in Visio in this ShapeSheet Reference.

In earlier versions of Visio, this function appears as _RUNADDON. Visio versions 4.0 and later accept either style.


Launches an add-on called Calendar.exe.

RUNADDON("Array Shapes")

Launches the (VSL-implemented) add-on whose name is Array Shapes.


Calls the ReportStatistics macro in the ThisDocument module in the document project containing this function call.

Note Note

To invoke a macro in the ThisDocument module, you must preface the string with "ThisDocument" as shown.


Calls the ReportStatistics macro in ModuleName in the document project that contains this function call.