Note: Starting with AutoCAD 2014-based products, custom applications must work under secure mode; when the SECURELOAD system variable is set to 1 or 2. When operating under secure mode, the program is restricted to loading and executing files that contain code from trusted locations; trusted locations are specified by the TRUSTEDPATHS system variable. For more information, see About Security and Protecting Against Viruses.
To Load a VBA Project
- At the Command prompt, enter
vbaman.
- In the VBA Manager dialog box, click Load.
- In the Open VBA Project dialog box, browse to and select the DVB file to load. Click Open.
- In the message box, click Enable Macros.
- Click Close.
To Unload a VBA Project
- At the Command prompt, enter
vbaman.
- In the VBA Manager dialog box, select the VBA project you want to unload. Click Unload.
- Click Close.
To Automatically Load a VBA Project and Run a Macro at Startup
- Save a VBA project with the file name
acad.dvb and place it in one of the product's support file search paths.
- In the VBA project, create a macro named AcadStartup and add the code you want executed at startup.
Note: Each time you start a new drawing session, the program searches for the
acad.dvb file and loads it.
To Load a VBA Project with AutoLISP
Do one of the following:
- Use the -VBALOAD command and specify the VBA project to load.
For example,
(command "_-vbaload" "mytools.dvb")
- Use the vl-vbaload function to load the provided VBA project.
For example,
(vl-vbaload "mytools.dvb")
Note: If you want the file to load at startup, define a S::STARTUP function in a AutoLISP file that is loaded automatically.