Share
 
 

To Load or Unload a VBA Project

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

  1. At the Command prompt, enter vbaman.
  2. In the VBA Manager dialog box, click Load.
  3. In the Open VBA Project dialog box, browse to and select the DVB file to load. Click Open.
  4. In the message box, click Enable Macros.
  5. Click Close.

To Unload a VBA Project

  1. At the Command prompt, enter vbaman.
  2. In the VBA Manager dialog box, select the VBA project you want to unload. Click Unload.
  3. Click Close.

To Automatically Load a VBA Project and Run a Macro at Startup

  1. Save a VBA project with the file name acad.dvb and place it in one of the product's support file search paths.
  2. In the VBA project, create a macro named AcadStartup and add the code you want executed at startup.
  3. 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.

Was this information helpful?