RunMacro Method

Back to Methods Reference

Runs a VBA macro from the Application object.


VBA : object.RunMacro(MacroPath)

VL : (vl-RunMacro object MacroPath)

(vla-RunMacro applic "test.dvb!Module1.macro")

  • Object : Application
    The object or objects this method applies to.

  • MacroPath : String; input-only
    A string representing the calling sequence of the macro to run. The calling sequence must have the following syntax, where [] represent optional parameters:


    : If Filename.dvb is followed by ProjectName, separate the names with an exclamation point instead of a period, as in the following example:


    The Filename.dvb specified will be loaded if it is not already loaded. If the path to the Filename.dvb is not specified, the system will look in the AutoCAD search path to try and locate the file. If ProjectName is not specified, the system will search all currently loaded projects to locate the macro.


To associate a macro with a popup menu or toolbar item, use the Macro property

Example :

(defun c:al-runmacro ()


(setq applic (vlax-get-acad-object))
(vla-RunMacro applic "test.dvb!Module1.macro")



The AutoLisp/Visual Lisp/VBA Resource Website
Search the WWW Search AfraLisp

Copyright 1999-Perpetuity by AfraLisp

All rights reserved.
Information in this document is subject to change without notice.
Site created and maintained by Kenny Ramage

The AutoLisp/Visual Lisp/VBA Resource Website