Run a VBA Macro from a Toolbar or Menu

You can run a VBA macro from an AutoCAD toolbar or menu by simply changing the Macro property for that toolbar or menu. The Macro property must be set equal to

-VBARUN filename.dvb!modulename.macroname

where filename is the name of the project file, modulename is the name of the module containing the macro to be run, and macroname is the name of the macro. The file name is only required when the file is not loaded in the current session of AutoCAD. If the file name is provided, the file will be loaded.

For more information on editing menus and toolbars, see Customize Toolbars and Menus.