Shortcut VBA like Excel - can't find how

Shortcut VBA like Excel - can't find how

Anonymous
Not applicable
504 Views
5 Replies
Message 1 of 6

Shortcut VBA like Excel - can't find how

Anonymous
Not applicable
I'd like to be able to run VBA code using CTRL + in the same way that I do with Excel VBA. I've looke but don't find that feature anywhere, and when I've searched this NG I've seen others ask the same question, but never with a simple direct answer FOR VBA code (although people address it for menus...I'm not interested in menus though). It seems like an obvious thing to do for repetitive tasks.

Thanks,
-Tony
0 Likes
505 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
Hi Tony,

Unlike Excel where typically the Macros are embedded in the spreadsheet, in
the main with VBA for AutoCAD the macros are stored in an external file
which needs to be loaded. This extra step provides an advantage to using a
menu command.

However, there is no reason why you couldn't load your program(s) on startup
and then define a Ctrl to invoke VBARUN, then select the macro
you want from the available list of macros, or define losts of
Crtl(Somethings> to run different commands.

Due to the different natures of AutoCAD cf Excel I rather suspect you'll
soon get sick of invoking a command, selecting a macro compared with
creating a Menu/Toolbar/specific keyboard shortcut/Palette method of
starting your macros.

--

Laurie Comerford
CADApps
www.cadapps.com.au
wrote in message news:5199277@discussion.autodesk.com...
I'd like to be able to run VBA code using CTRL + in the same way
that I do with Excel VBA. I've looke but don't find that feature anywhere,
and when I've searched this NG I've seen others ask the same question, but
never with a simple direct answer FOR VBA code (although people address it
for menus...I'm not interested in menus though). It seems like an obvious
thing to do for repetitive tasks.

Thanks,
-Tony
0 Likes
Message 3 of 6

Anonymous
Not applicable
First create a lisp command wrapper for the macro (search the ng for this
part), then assign the lisp to a key using the normal pgp methods.

--
----
Ed
----
0 Likes
Message 4 of 6

Anonymous
Not applicable
"... and then define a Ctrl to invoke VBARUN, then select the
macro
you want from the available list of macros..."

Like Alt-F8?
--
James Allen
Malicoat-Winslow Engineers, P.C.
Columbia, MO


"Laurie Comerford" wrote in message
news:5199513@discussion.autodesk.com...
0 Likes
Message 5 of 6

Anonymous
Not applicable
Thank you, Laurie, for the explanation. Up to now I'd only been writing VBA to drive AutoCAD using VBA, so I hadn't appreciated the difference between VBA in Excel and AutoCAD. Now I can see why I couldn't find how to do what I was trying, and why learning the menu approach will be necessary when using pure AutoCAD vba.

-Tony
0 Likes
Message 6 of 6

Anonymous
Not applicable
Mistake: I meant to say: "...up till now I'd only been writing VBA to drive AutoCAD using Excel"
0 Likes