Starting exe from a CatVBA

Balla Zoltan

Starting exe from a CatVBA

Hi,

I have an exe file that creates a txt File.

when I start it from Windows -double-clicking on it- works perfectly but using the following syntax:

       Shell FilePath, vbMaximizedFocus

or

       CATIA.SystemService.ExecuteProcessus FilePath

it makes nothing:

What could be the reason?

 

 

Edited By:
Balla Zoltan[Subscriber Members] @ Mar 29, 2021 - 09:01 PM (Europe/Berlin)

Balla Zoltan

RE: Starting exe from a CatVBA
(in response to Balla Zoltan)

Hi together,

unfortunately i couldn't find out why that two methods doesn't work, but I can share with you the solution I found that works in my situation:

Function ShellExecuteVB()
    Dim objShell
    Set objShell = CreateObject("Shell.Application")
    Call objShell.ShellExecute("notepad.exe", "", "", "open", 1)
End Function

Maybe it will be helpful for somebody.

Little Cthulhu

RE: Starting exe from a CatVBA
(in response to Balla Zoltan)

Strange.

ExecuteProcessus works fine, although I prefer CreateObject("WScipt.Shell").Run that gives more options.

Balla Zoltan

RE: Starting exe from a CatVBA
(in response to Little Cthulhu)

Hi,

Only for information: I also tried your sugestion to use the

         CreateObject("WScipt.Shell").Run

but unfortunatly with the same result.

Little Cthulhu

RE: Starting exe from a CatVBA
(in response to Balla Zoltan)

I suspect there may be something with your application.

Do all things that you've tried work fine for notepad.exe?