Running a vb6.0 project from vba code

Running a vb6.0 project from vba code

Anonymous
Not applicable
230 Views
5 Replies
Message 1 of 6

Running a vb6.0 project from vba code

Anonymous
Not applicable
Is it possible to run an executable I made in vb6.0 right from my vba
code? If so, can anyone tell me how this is done? Thanks in advance.
0 Likes
231 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
Yes. If your app is an ActiveX server, use GetInterfaceObject. If not, use
Shell.

--
The Common Sense Copyright
You are free to do whatever you want with the information in this post.
I only ask two things:
1) If you reprint it, please credit me as the author.
2) If you make money with it, please cut me in.

http://www.acadx.com

"Monica" wrote in message
news:9122EFCAB50BE2B75E246D5B295E5FE4@in.WebX.SaUCah8kaAW...
> Is it possible to run an executable I made in vb6.0 right from my vba
> code? If so, can anyone tell me how this is done? Thanks in advance.
>
0 Likes
Message 3 of 6

Anonymous
Not applicable
Actually, the sole purpose of this short vba program is to allow the user,
while in autocad, to click on my toolbar icon and run a vb6.0 .exe. The
only way I know how to do this is through vba code. Is this thinking
correct?

"Frank Oquendo" wrote in message
news:2DD4370E09DC35FF516457815C3A964E@in.WebX.SaUCah8kaAW...
> Yes. If your app is an ActiveX server, use GetInterfaceObject. If not, use
> Shell.
>
> --
> The Common Sense Copyright
> You are free to do whatever you want with the information in this post.
> I only ask two things:
> 1) If you reprint it, please credit me as the author.
> 2) If you make money with it, please cut me in.
>
> http://www.acadx.com
>
> "Monica" wrote in message
> news:9122EFCAB50BE2B75E246D5B295E5FE4@in.WebX.SaUCah8kaAW...
> > Is it possible to run an executable I made in vb6.0 right from my vba
> > code? If so, can anyone tell me how this is done? Thanks in advance.
> >
>
0 Likes
Message 4 of 6

Anonymous
Not applicable
Hi Monica,
You can use startapp. In a toolbar button:
(startapp "mypath/myfile.exe")

-Josh

Monica wrote:

> Actually, the sole purpose of this short vba program is to allow the user,
> while in autocad, to click on my toolbar icon and run a vb6.0 .exe. The
> only way I know how to do this is through vba code. Is this thinking
> correct?
>
> "Frank Oquendo" wrote in message
> news:2DD4370E09DC35FF516457815C3A964E@in.WebX.SaUCah8kaAW...
> > Yes. If your app is an ActiveX server, use GetInterfaceObject. If not, use
> > Shell.
> >
> > --
> > The Common Sense Copyright
> > You are free to do whatever you want with the information in this post.
> > I only ask two things:
> > 1) If you reprint it, please credit me as the author.
> > 2) If you make money with it, please cut me in.
> >
> > http://www.acadx.com
> >
> > "Monica" wrote in message
> > news:9122EFCAB50BE2B75E246D5B295E5FE4@in.WebX.SaUCah8kaAW...
> > > Is it possible to run an executable I made in vb6.0 right from my vba
> > > code? If so, can anyone tell me how this is done? Thanks in advance.
> > >
> >
0 Likes
Message 5 of 6

Anonymous
Not applicable
tried that suggestion, but I got this error ;
"unknown command STARTAPP"

"Minkwitz Design" wrote in message
news:3A196051.3858DA19@minkwitz-design.com...
> Hi Monica,
> You can use startapp. In a toolbar button:
> (startapp "mypath/myfile.exe")
>
> -Josh
>
> Monica wrote:
>
> > Actually, the sole purpose of this short vba program is to allow the
user,
> > while in autocad, to click on my toolbar icon and run a vb6.0 .exe. The
> > only way I know how to do this is through vba code. Is this thinking
> > correct?
> >
> > "Frank Oquendo" wrote in message
> > news:2DD4370E09DC35FF516457815C3A964E@in.WebX.SaUCah8kaAW...
> > > Yes. If your app is an ActiveX server, use GetInterfaceObject. If not,
use
> > > Shell.
> > >
> > > --
> > > The Common Sense Copyright
> > > You are free to do whatever you want with the information in this
post.
> > > I only ask two things:
> > > 1) If you reprint it, please credit me as the author.
> > > 2) If you make money with it, please cut me in.
> > >
> > > http://www.acadx.com
> > >
> > > "Monica" wrote in message
> > > news:9122EFCAB50BE2B75E246D5B295E5FE4@in.WebX.SaUCah8kaAW...
> > > > Is it possible to run an executable I made in vb6.0 right from my
vba
> > > > code? If so, can anyone tell me how this is done? Thanks in
advance.
> > > >
> > >
>
0 Likes
Message 6 of 6

Anonymous
Not applicable


Did you place it in the parenthesis so that it is recognized as lisp? In
addition, add a semicolon at the end for a return stroke. From the acad
help files on the topic:

You can use the acad.pgp file to define a new AutoCAD command that runs
an external command to start your application. The following example defines
the RUNAPP1 command, which runs the application app1.exe in the C:\vbapps\
directory. (Add this code to the external commands section of your acad.pgp
file.)

RUNAPP1, start c:\vbapps\app1, 0

If your application requires command line parameters, you can use the
following code:

RUNAPP2, start c:\vbapps\app2, 0, *Parameters: ,

The previous example defines the RUNAPP2 command, which prompts you
for parameters and then passes them to your application. For more information
on the acad.pgp file, see "acad.pgp—Program Parameters File."

You can also use the AutoLISP startapp function
to start an application that makes use of Automation. Once AutoLISP starts
the external application, it has no control over its actions. You can,
however, use AutoLISP to locate and run different applications based on
certain parameters.

Starts a Windows application

(startapp appcmd [file])

Arguments

appcmd

A string that specifies the application to execute. If appcmd does not
include a full path name, startapp searches the directories in the PATH
environment variable for the application.

file

A string that specifies the file name to be opened.

Return Values

An integer greater than 0, if successful, otherwise nil.

Examples

The following code starts the Windows Notepad and opens the acad.lsp
file.

Command: (startapp "notepad" "acad.lsp")

33

If an argument has embedded spaces, it must be surrounded by literal
double quotes. For example, to edit the file my  stuff.txt with Notepad,
use the following syntax:

Command: (startapp "notepad.exe" "\"my stuff.txt\"")

33

-Josh

 

Monica wrote:

tried that suggestion, but I got this error ;

"unknown command STARTAPP"

"Minkwitz Design" <mds@minkwitz-design.com> wrote in message

news:3A196051.3858DA19@minkwitz-design.com...

> Hi Monica,

>     You can use startapp. In a toolbar button:

> (startapp "mypath/myfile.exe")

>

> -Josh

>

> Monica wrote:

>

> > Actually, the sole purpose of this short vba program is to allow
the

user,

> > while in autocad, to click on my toolbar icon and run a vb6.0 .exe. 
The

> > only way I know how to do this is through vba code.  Is this
thinking

> > correct?

> >

> > "Frank Oquendo" <franko@nospam.stonemedia.com> wrote in message

> > news:2DD4370E09DC35FF516457815C3A964E@in.WebX.SaUCah8kaAW...

> > > Yes. If your app is an ActiveX server, use GetInterfaceObject.
If not,

use

> > > Shell.

> > >

> > > --

> > > The Common Sense Copyright

> > > You are free to do whatever you want with the information in
this

post.

> > > I only ask two things:

> > > 1) If you reprint it, please credit me as the author.

> > > 2) If you make money with it, please cut me in.

> > >

> > > http://www.acadx.com

> > >

> > > "Monica" <meisfeld@supersky.com> wrote in message

> > > news:9122EFCAB50BE2B75E246D5B295E5FE4@in.WebX.SaUCah8kaAW...

> > > >   Is it possible to run an executable I made in vb6.0
right from my

vba

> > > > code?  If so, can anyone tell me how this is done? 
Thanks in

advance.

> > > >

> > >

>


<
0 Likes