2012

Table Of Contents
VBAMAN
Manages VBA project operations using a dialog box.
VBARUN
Runs a VBA macro.
VBASTMT
Executes a VBA statement at the AutoCAD Command prompt.
VBAUNLOAD
Unloads a global VBA project.
Use AutoCAD VBA Applications
You load a VBA project with the VBALOAD command. Once loaded, its
modules and macros are available in the Macros dialog box.
Although Microsoft applications store VBA projects, macros, and programs
inside a specific document, AutoCAD uses a separate file with the .dvb
extension. In this way, VBA interfaces with AutoCAD in much the same way
that AutoLISP and ObjectARX do. Because VBA projects are stored in a separate
file, a VBA project can open and close different AutoCAD drawings during an
AutoCAD session.
NOTE AutoCAD VBA projects are not binary compatible with stand-alone Visual
Basic 6 projects (VBP files). However, forms, modules, and classes can be exchanged
between dissimilar projects using the IMPORT and EXPORT VBA commands in the
VBA integrated development environment (IDE).
You load a VBA project with the VBALOAD command. Once loaded, its
modules and macros are available in the Macros dialog box. To run the VBA
module you use the VBARUN command. If no VBA project is loaded, the
options are unavailable. Procedures listed in the Macro Name box use the
following syntax:
module.macro
In the Macros dialog box you choose the Macro Scope and select from the
listed modules.
Use the Command Prompt to Run a VBA Macro
The -VBARUN command can be used to run a macro from the command
prompt. This allows you to run VBA macros from the command prompt,
430 | Chapter 7 Introduction to Programming Interfaces