I have a batch file that essentially just checks the version of MSExcel and opens a different file based on that. However, I'm running into a strange problem where, after successfully running the batch file, Excel returns the error:
"The file could not be accessed. Try one of the following:" (Lists suggestions)
The strangest part, though, is that when I press OK, the file still opens properly! I really would love to get rid of this error for my users; what could I do to get rid of it?
Here is my code, in case anyone was wondering.
@echo off
echo %~dp0
if exist "C:\Program Files\Microsoft Office\Office14\EXCEL.EXE" GOTO L2010
if exist "C:\Program Files\Microsoft Office\Office12\EXCEL.EXE" GOTO L2007
if exist "C:\Program Files\Microsoft Office\Office11\EXCEL.EXE" GOTO L2003
echo "Excel not installed"
pause
GOTO End
:L2010
:L2007
Start excel.exe %~dp0 "resources\SQL_Report_Compiler.xlsm"
GOTO End
Pause
:L2003
Start excel.exe %~dp0 "resources\SQL_Report_Compiler.xls"
:End