Hello
I am trying to use the objWshShell.run command to execute an ade file.
iReturn = objWshShell.run("C:\abcd.ade")
when I run the vbs script nothing happens, no error msgs or ade running.
when I use the same script with the following line
iReturn = objWshShell.run("abcd.exe")
notepad runs
I have also tried to execute a spreadsheet from the C drive with no luck.
iReturn = objWshShell.run("abcd.xls")
abcd.exe
abcd.ade
abcd.xls
exist on C:\
below is my script
Option Explicit
'-------------------------------------------------------------
' Mainline
'-------------------------------------------------------------
Dim objWshShell, iReturn, sRunCommand
' create a shell object
Set objWshShell = WScript.CreateObject("WScript.Shell")
iReturn = objWshShell.run("notepad.exe")
if iReturn <> 0 then
i = msgbox ("Error starting application. " & vbnewline & sRunCommand _
& vbnewline & "Return code = " & cstr(iReturn),,"WScript.ScriptFullName")
end if
' cleanup
set objWshShell = Nothing
wscript.quit(0)
thanks for any replies