Runs a VBA macro
Supported Platforms: AutoCAD for Windows only; not available in AutoCAD LT for Windows, or on Mac OS and Web
Signature
(vl-vbarun macroname)
- macroname
-
Type: String
Name of a macro in a loaded VBA project.
Return Values
Type: String or error
The value of the macroname argument; otherwise, an error occurs.
Release Information
- AutoCAD R14 and later on Windows
Releases:
Examples
Load a VBA project file:
(vl-vbaload "c:/program files/<AutoCAD installation directory>/sample/vba/drawline.dvb") "c:\\program files\\<AutoCAD installation directory>\\sample\\vba\\drawline.dvb"
Run a macro from the loaded project:
(vl-vbarun "drawline") "drawline"