How to create macro to load VBA project?

Since I find I must regularly load a particular drawing, and a VBA project I am working on, I am trying to make a macro for it.I've tried every possible way I can think of, and always get a "file not found". It certainly seems to be an issue with the full path name.I've tried with and without quotes, forward slashes, and backward slashes. Is this a bug, or am I missing something?Actually, I've failed at many attempts to create any custom button, or create any custom toolbar. So, I am sticking to scripts.Is there anything wrong with the following line in a script?_vbaload;"C:\Ram Freezers\CUSTOM PROGRAMS\chamber.dvb";when I run it, I get a message that seems to indicate that BricsCad will only look in its default VBA directory. Is this so? Here is the line from my history window;Could not find file "C:\Program Files\Bricsys\Bricscad\"C:\RAM Freezers\CUSTOM PROGRAMS\chamber.dvb"".Joe Dunfee

Comments

  • I would change your:_vbaload; "C:\Ram Freezers\CUSTOM PROGRAMS\chamber.dvb";to:(command "-vbaload" "C:\Ram Freezers\CUSTOM PROGRAMS\chamber.dvb")So within our script we use lisp syntax (). The lisp srting above uses the 'command' function which takes two arguments:-the name of the command to execute (-vbaload)-the filename of the dvb project to load. Note that the because we are within Lisp each "\" has to be escaped and becomes "\"Once the project is loaded we could call a subroutine within the project. For instance you wish to run a Sub (lets say Main) within a module (lets say Module1) we would use(command "-vbarun" "chamber.Module1.Main")

  • I don't think I stated this earlier, but I am on version 8.I still get the "could not find file" error message. To confirm that I have the path correct, I copied-pasted the path from windows explorer, and then replaced the \ slashes with \.I also tried placing a copy of the VBA dvb file in the BricsCad program directory, then removing the path from the script. This time it worked.It seems that the _vbaload command will not accept a path.Joe Dunfee

  • ok so you don't want to use the lsip syntax...up to you. Then I think this should work:-vbaload;C:\Ram Freezers\CUSTOM PROGRAMS\chamber.dvb

  • Well it is not that "I" don't want to use LISP, it is that BricsCad doesn't want to use lisp!The direct command line version is what i first tried, and I tried it again at your suggestion. But, the result is the same... it doesn't like spaces in the path. I tried the command line version with quotes around the path/filename, but then it doesn't seem to recognize it as a valid filename.The fact that you are replying to my messages suggest that these commands are working for you. Is the correct? Are you able to have spaces in your paths?Joe Dunfee

This discussion has been closed.