Autoloading VBA and Running Macro
I am trying to figure out two things.1. How to have a VBA project loaded automatically every time BricsCad V8 is started.2. Once the VBA project is loaded how to run a specific macro in the project from either a toolbar button (preferred) or a drop down option. ie I need to know how to create the button and the syntax of the command need to launch the macro.Thanks,Jon
Comments
-
As you correctly put it this is a 2 step operation: 1 loading the vba project; 2 running a macro within that project.Both steps can be cast in a lisp expression -typically step 1 could be included into the on_start.lsp while step 2 could be bound to a button and/or menu item.(command "-vbaload" "D:\Data\dvb\MyVbaProject.dvb")(command "-vbarun" "MyVbaProject.Module1.Main")In the above expample the project MyVbaProject.dvb is first loaded (vbaload command), then the sub called 'Main' gets executed (vbarun command). for -vbarun please note the syntax:(command "-vbarun" "ProjectName.ModuleName.SubOrFunctionName")Hope this helps,Ferdinand Janssens
0 -
Sorry, but the code for calling the macro don't run on my system, but when I use(command "_-vbarun" "MyVbaProject.Module1.Main") then it works fine.Regards - Peter
0