Repeating VBA Macros

Discussion in 'AutoCAD' started by J Haag, Dec 22, 2003.

  1. J Haag

    J Haag Guest

    Hola,

    Does anyone know how to repeat a VBA macro assigned to a toolbar button by
    just hitting enter, the spacebar or right mouse button. Right now I have to
    select the toolbar button everytime I want to run the routine because If I
    try to repeat it any other way, just the "-vbarun" command executes and
    prompts for a macro name at the command line. Do I have to add some type of
    object method or property to my code to make it (the "-vbarun abcd.dvb!abcd"
    combination) stick in the command history. I'm using Autocad 2000.

    Thanks for any help.

    John
     
    J Haag, Dec 22, 2003
    #1
  2. Create a LISP command wrapper for your VBA macro, and
    call it from the menu:

    (defun C:SOMECOMMAND ()
    (vl-vbarun "Some.dvb!SomeMacro")
    (princ)
    )

    In your menu macro, just place the name of the command:

    [Button1]^c^cSOMECOMMAND
     
    Tony Tanzillo, Dec 22, 2003
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.