VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Menu Costumization: how to load a customized macro?

2 REPLIES 2
Reply
Message 1 of 3
NeedHelpinVBA
238 Views, 2 Replies

Menu Costumization: how to load a customized macro?

Hello All,

I managed to create a personnalized menu that I can add in the menu bar but I would like to customize each item of this drop down menu. I mean that when you click on the first label for instance you have access to a function that I coded in VBA.
This menu works when I write "P1-2[&Prototype]^C^CCopy" for example. But I would like to access my function instead of Copy.

Here is what I tried:

***MENUGROUP=TEST1
***POP1
P1-1[& Test]
P1-2[& Prototype]^C^C(vl-vbaload "\\C:\Program Files\New Menu\code.dvb")(vl-vbarun "AAStartThePrototype")

This code does not work.. Can you help me please?

Thanks,

Regards,
2 REPLIES 2
Message 2 of 3

I finally managed to find the solution! Anyway thank you if you wanted to help me!
Message 3 of 3
Anonymous
in reply to: NeedHelpinVBA

Hi NeedHelpinVBA,

Try this:

{code}
P1-2[& Prototype]^C^C^C(vl-vbarun "C:\\Program Files\\New Menu\\code.dvb!AAStartThePrototype")
{code}

You can test this from the command line with:

{code}
(vl-vbarun "C:\\Program Files\\New Menu\\code.dvb!AAStartThePrototype")
{code}

If it doesn't wok, you may need the use (vl-load-com) first

Regards,


Laurie Comerford


NeedHelpinVBA wrote:
> Hello All,
>
> I managed to create a personnalized menu that I can add in the menu bar but I would like to customize each item of this drop down menu. I mean that when you click on the first label for instance you have access to a function that I coded in VBA.
> This menu works when I write "P1-2[&Prototype]^C^CCopy" for example. But I would like to access my function instead of Copy.
>
> Here is what I tried:
>
> ***MENUGROUP=TEST1
> ***POP1
> P1-1[& Test]
> P1-2[& Prototype]^C^C(vl-vbaload "\\C:\Program Files\New Menu\code.dvb")(vl-vbarun "AAStartThePrototype")
>
> This code does not work.. Can you help me please?
>
> Thanks,
>
> Regards,
>

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost