>declare long FindExecutable in "shell32.dll" ; >string cFile, string cDirectory, string @cResult > >cBuffer = space(255) >nRetVal = FindExecutable("important.xls",'\\SMDSRV3\Sampling\Application\Executable' , @cBuffer) >if nRetVal < 32 > messageBox("You don't have Excel installed, sorry.",64) > return >endif>It runs okay somethimes, but not others. When I changed 32 to 31, it always seems to run fine. However, I have not tested it on a machine without Excel, and I'm concerned that may cause a problem.
#define SE_ERR_FNF 2 && file not found #define SE_ERR_PNF 3 && path not found #define SE_ERR_ACCESSDENIED 5 && access denied #define SE_ERR_OOM 8 && out of memory #define SE_ERR_SHARE 26 && A sharing violation occurred. #define SE_ERR_ASSOCINCOMPLETE 27 && Filename association isn't complete or invalid. #define SE_ERR_DDETIMEOUT 28 && DDE Transaction timed out #define SE_ERR_DDEFAIL 29 && DDE Failure #define SE_ERR_DDEBUSY 30 && DDE Busy #define SE_ERR_NOASSOC 31 && No application associated #define SE_ERR_DLLNOTFOUND 32I should point out that many of these would only apply to using ShellExecute.