View Full Version : How do I execute a VBA macro from within lisp

2005-01-18, 10:55 PM
I am beginning to learn VB and a Co-Worker is beginning to learn about CAD... he already knows VB and we are trying to combine programs. I have a lisp routine that ask some question from the user to fill out the attributes in a title block and I would like to hook that up to his macro that already gets that info for me. He has 5 variables that I need and they would save my users all the typing. My question is how do I call his macro and get back the data I need from it. I'm not quite ready to pull info from a data base and put it in CAD for myself yet so I want to rely on my existing AutoLisp until I learn VB.

2005-01-31, 03:54 PM
I tried the same thing and did not succeed but what I did do was made a customized button.

First, I created a module and called it start. All of the drawings that I have created and have code in it has this module in it.

Second,I created the following code.
Sub start()
[name].Show 'name is the name of the module or form that you want to run.
End Sub

Then I created the custom button and put in the following code under it,

Now, no matter what drawing I have open, I can run the macro for that drawing as long as I have the module, "Sub Start()".

Ed Jobe
2005-01-31, 04:48 PM
I moved this to the vba forum as I think you will get more answers here. Lisp and vba aren't languages that can readily "talk" to each other and requires some advanced skills. Please be a bit more specific about the requirements of both your vba and lisp portions.

Thank you.