Articles

executing exe file in EXCEL

November 27, 2009 at 05:19:16
Specs: Windows NT

Failed to run exe file in Excel by using Shell function.Please let me know if there any other method/function to run exe file in Excel

See More: executing exe file in EXCEL

Report •


#1
November 27, 2009 at 11:41:49

You need to give us some more info.

The example in the VBA Help files works fine for me, so you need to give us some details as to the symptoms or error messages, etc.

"Failed to run..." just isn't enough for us to work with.

This works fine for me:

Sub Run2Apps()
Dim RetVal
' Run Calculator
  RetVal = Shell("C:\WINDOWS\system32\CALC.EXE", 1)
' Run Word
  RetVal = Shell("C:\Program Files\Microsoft Office\OFFICE11\winword.exe", 1)
End Sub


Report •

#2
December 2, 2009 at 04:59:06

I tried your example and it works fine .While I am running below program, observed the error "Missing files"
Sub Run2Apps()
Dim RetVal
' Running test program
RetVal = Shell("C:\PRA_AIAO\TCS_NT.exe", 1)
End Sub

I will restate my problem once again,
I have 4 .exe files and I would like to run the .exe file automatically .(I wriiten the macros in excel which will select .exe file as per requirement ).
While running Shell function, observed "Missing Files" error but .exe file works fine when using RUN explorer
So please let me know if you have any suggestion,


Report •

#3
December 2, 2009 at 05:36:42

Hi,

If I run the Shell function in Excel with an exe file that is missing I get the error message

Run-time error '53': File not found 
I don't get a message 'Missing files'.

Is it possible that TCS_NT.exe is generating the error.

When the error appears, does TCS_NT.exe appear in the Windows task Manager Process list. (Alt+Shift+Esc, then Processes tab)

Regards


Report •

Related Solutions

#4
December 2, 2009 at 06:01:26

I can produce a:

Run-time error '53': File not found 

if the file doesn't exist in the path, or an

Run-time error '76': Path not found 

if the path doesn't exist.

I can't seem to produce a "Missing Files" error.

A quick Google search didn't return any hits for a VBA Shell "Missing Files" error, but does for "File not found" and "Path not found".

Can you supply your exact code so we can take a look at it?


Report •


Ask Question