Newbie question here

Newbie question here

Anonymous
Not applicable
296 Views
4 Replies
Message 1 of 5

Newbie question here

Anonymous
Not applicable
I've written a small program that calculates the mass of an object and saved
it as a *.dvb.
I've also made a new pulldown menu from which I would like to run this
project.

I've used a "-vbaload" command to load it but I don't know how to run it
then.

Thanks for your help, Marko.
0 Likes
297 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Use VBARUN to execute a macro. You might consider using VL-VBARUN:
^C^C^P(vl-vbarun "c:/temp/myproject.dvb!Module1.MyMacro")

Put the above code under a toolbar button. It automatically loads your
project if necessary. It also avoids the annoying macro virus dialog
associated with the VBALOAD command. Just change the file path, module
name and macro name as appropriate.

Good luck.

--
"That's no ordinary rabbit."
http://www.acadx.com


"Marko Rogic" wrote in message
news:471FA9FBF93A2F54B39ABF540ECE403D@in.WebX.maYIadrTaRb...
> I've written a small program that calculates the mass of an object
and saved
> it as a *.dvb.
> I've also made a new pulldown menu from which I would like to run
this
> project.
>
> I've used a "-vbaload" command to load it but I don't know how to
run it
> then.
>
> Thanks for your help, Marko.
>
>
0 Likes
Message 3 of 5

Anonymous
Not applicable
Ok....
Still lost you know...:-)

I understand this part of the command... (vl-vbarun "c:/temp/myproject.dvb
but I'm a little lost here... !Module1.MyMacro")
I've written the whole code in Code window under Forms. I haven't inserted
any modules or anything else. Perhaps this isn't the correct way to write
programs under VBA. Anyway the programs runs just nicely if I start it
through VBA Editor.

Any help is greatly appreciated. Thanks in advance.



"Frank Oquendo" wrote in message
news:83DA6C93A934ECCF9F7103875B8D9D94@in.WebX.maYIadrTaRb...
> Use VBARUN to execute a macro. You might consider using VL-VBARUN:
> ^C^C^P(vl-vbarun "c:/temp/myproject.dvb!Module1.MyMacro")
>
> Put the above code under a toolbar button. It automatically loads your
> project if necessary. It also avoids the annoying macro virus dialog
> associated with the VBALOAD command. Just change the file path, module
> name and macro name as appropriate.
>
> Good luck.
0 Likes
Message 4 of 5

Anonymous
Not applicable
The macro is for use in a toobar button. Cut it from your project and
paste it into a toolbar button. When you press the button, it'll run
your VBA routine.

--
"That's no ordinary rabbit."
http://www.acadx.com

Visit my site for a chance to win
a free, autographed copy of
Jerry Winters' "AutoCAD Visual Basics"

"Marko Rogic" wrote in message
news:5027DB20252FF9096F507C481B3733C2@in.WebX.maYIadrTaRb...
> Ok....
> Still lost you know...:-)
>
> I understand this part of the command... (vl-vbarun
"c:/temp/myproject.dvb
> but I'm a little lost here... !Module1.MyMacro")
> I've written the whole code in Code window under Forms. I haven't
inserted
> any modules or anything else. Perhaps this isn't the correct way to
write
> programs under VBA. Anyway the programs runs just nicely if I start
it
> through VBA Editor.
>
> Any help is greatly appreciated. Thanks in advance.
0 Likes
Message 5 of 5

Anonymous
Not applicable
I've written the whole code in Code window under Forms. I haven't
inserted any modules or anything else.

You will need to insert a standard module or you will only be able to
run your form from the editor. Insert a standard module, then place the
following sub in it:

sub MyMacro()
MyFormName.Show
end sub

If you are not actually using a form (dialogue box), then you need to
cut the code from the window you have it in and paste it in a standard
module.
Then use the line Frank gave you for the toolbar button,,, where Module1
is the name of the module and Mymacro is the name of the sub inside of
the module.



Marko Rogic wrote:

> Ok....
> Still lost you know...:-)
>
> I understand this part of the command... (vl-vbarun "c:/temp/myproject.dvb
> but I'm a little lost here... !Module1.MyMacro")
> I've written the whole code in Code window under Forms. I haven't inserted
> any modules or anything else. Perhaps this isn't the correct way to write
> programs under VBA. Anyway the programs runs just nicely if I start it
> through VBA Editor.
>
> Any help is greatly appreciated. Thanks in advance.
>
>
>
> "Frank Oquendo" wrote in message
> news:83DA6C93A934ECCF9F7103875B8D9D94@in.WebX.maYIadrTaRb...
>
>>Use VBARUN to execute a macro. You might consider using VL-VBARUN:
>>^C^C^P(vl-vbarun "c:/temp/myproject.dvb!Module1.MyMacro")
>>
>>Put the above code under a toolbar button. It automatically loads your
>>project if necessary. It also avoids the annoying macro virus dialog
>>associated with the VBALOAD command. Just change the file path, module
>>name and macro name as appropriate.
>>
>>Good luck.
>>
>
>
>
0 Likes