launching an .exe from a macro?

launching an .exe from a macro?

Post by Elz » Tue, 12 Feb 2002 03:27:14



Hi,

Just wondering if it is possible to launch an executable file from a SW
macro? If so
can someone post the line of code please?

I've tried recording the procedure but it doesn't work.

 
 
 

launching an .exe from a macro?

Post by KKreb » Tue, 12 Feb 2002 02:48:24


Elz,

Try the below:

Sub main()
Dim SW_Title
  SW_Title = Shell("c:\program files\Solidworks\Title.exe", [vbNormalFocus])

Set swApp = CreateObject("SldWorks.Application")
End Sub

--

Cheers,

Kevin R. Krebs
Plano, Texas


Quote:> Hi,

> Just wondering if it is possible to launch an executable file from a SW
> macro? If so
> can someone post the line of code please?

> I've tried recording the procedure but it doesn't work.


 
 
 

launching an .exe from a macro?

Post by f » Tue, 12 Feb 2002 05:02:50



> Hi,

> Just wondering if it is possible to launch an executable file from a SW
> macro? If so
> can someone post the line of code please?

> I've tried recording the procedure but it doesn't work.

using the shell command this is pretty easy

retval = Shell("D:\program path\program.exe", 1)

just enter the actual path of the exe in the above string

fh