Load and Run VBA for presentation - HELP!

Load and Run VBA for presentation - HELP!

mdhutchinson
Advisor Advisor
444 Views
5 Replies
Message 1 of 6

Load and Run VBA for presentation - HELP!

mdhutchinson
Advisor
Advisor
OKAY... I have exactly 1 hour...

can I get some quick help...

my first VBA project!!!! Newbe here

so far all I've been doing in VBA is set the UserForm1 as the current module and clicking on the Run tool bar pick.

I am not even certain what USERFORM proceedure is the one I need to run it from AutoCAD command line... HELP

... my presentation starts in 45 minutes!!
How do I load and run it from the command line without VBAIDE running?
0 Likes
445 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
You need to define a command with lisp.

(defun C:MYCOMMAND () (vl-vbarun "macroname"))

....or something to that effect. There are probably 3 dozen threads on this
topic.

wrote in message news:5449732@discussion.autodesk.com...
OKAY... I have exactly 1 hour...

can I get some quick help...

my first VBA project!!!! Newbe here

so far all I've been doing in VBA is set the UserForm1 as the current module
and clicking on the Run tool bar pick.

I am not even certain what USERFORM proceedure is the one I need to run it
from AutoCAD command line... HELP

... my presentation starts in 45 minutes!!
How do I load and run it from the command line without VBAIDE running?
0 Likes
Message 3 of 6

Anonymous
Not applicable
Hutch,

Create a public sub in a standard module (or ThisDrawing) that shows the
form. That public sub is exposed as a macro inside AutoCAD.

Public Sub Main()
UserForm1.Show
End Sub

--
R. Robert Bell


wrote in message news:5449732@discussion.autodesk.com...
OKAY... I have exactly 1 hour...

can I get some quick help...

my first VBA project!!!! Newbe here

so far all I've been doing in VBA is set the UserForm1 as the current module
and clicking on the Run tool bar pick.

I am not even certain what USERFORM proceedure is the one I need to run it
from AutoCAD command line... HELP

... my presentation starts in 45 minutes!!
How do I load and run it from the command line without VBAIDE running?
0 Likes
Message 4 of 6

mdhutchinson
Advisor
Advisor
The project is loaded...
But I don't know what to type in for the vl-vbarun

the name of the project...?
one of the form level functions?
what?
0 Likes
Message 5 of 6

mdhutchinson
Advisor
Advisor
Thanks Robert for this morning...

I get very busy the last two days and could prepare for my presentation... consequently I had a rush this morning...
you saved me.

Thanks...

The Main sub was just what I needed...

okay... I am now back at developing it further...

Anyway... I want to put a pick in a menu system to run the application...
Is it the case that I need a couple lines of lisp code to load and run my application?
I would assume that I need:

(vl-vbaload "MyPathAndFile")
(vl-vbarun "main")

Is this it? ... is this the best way to load and run VBA applications?
0 Likes
Message 6 of 6

Anonymous
Not applicable
Running a macro from lisp has been discussed over and over. Do a search
here.

BTW, glad I could help.

--
R. Robert Bell


wrote in message news:5450445@discussion.autodesk.com...
Thanks Robert for this morning...

I get very busy the last two days and could prepare for my presentation...
consequently I had a rush this morning...
you saved me.

Thanks...

The Main sub was just what I needed...

okay... I am now back at developing it further...

Anyway... I want to put a pick in a menu system to run the application...
Is it the case that I need a couple lines of lisp code to load and run my
application?
I would assume that I need:

(vl-vbaload "MyPathAndFile")
(vl-vbarun "main")

Is this it? ... is this the best way to load and run VBA applications?
0 Likes