matlab xlsread fails under windows autosys; how can I make it work?

7 views (last 30 days)
I have a windows bat file run.bat which runs a matlab script myfile.m by executing line: "C:\Program Files\MATLAB\R2014b\bin\matlab.exe" -nosplash -noFigureWindows -wait -r "run('myfile.m'); quit"
If I log in, bring up a command shell, and type "run.bat" to run it, it works perfectly.
The myfile.m uses xlsread to read input *.csv files, does processing and writes out "result.xls" excel file.
Below shows the logfile from running under autosys - so you can see the xlsread function is failing.
Is there anything we can do to make xlsread work when running under autosys - maybe some environment variable needs to be set?
MATLAB is running in headless mode. Figure windows will not be displayed. reading input files {Error using href="matlab:matlab.internal.language.introspective.errorDocCallback('xlsread', 'C:\Program Files\MATLAB\R2014b\toolbox\matlab\iofun\xlsread.m', 247)" style="font-weight:bold">xlsread</a (<a href="matlab: opentoline('C:\Program Files\MATLAB\R2014b\toolbox\matlab\iofun\xlsread.m',247,0)">line 247</a>) Invoke Error, Dispatch Exception: Source: Microsoft Office Excel Description: Open method of Workbooks class failed Help File: D:\Program Files\Microsoft Office\OFFICE11\1033\xlmain11.chm Help Context ID: 0
Error in href="matlab:matlab.internal.language.introspective.errorDocCallback('myfile', 'myfile.m', 7)" style="font-weight:bold">myfile</a (<a href="matlab: opentoline('myfile.m',7,0)">line 7</a>) [M_DAT01, T_DAT01]=xlsread('input_file.csv');
Error in href="matlab:matlab.internal.language.introspective.errorDocCallback('run', 'C:\Program Files\MATLAB\R2014b\toolbox\matlab\lang\run.m', 63)" style="font-weight:bold">run</a (<a href="matlab: opentoline('C:\Program Files\MATLAB\R2014b\toolbox\matlab\lang\run.m',63,0)">line 63</a>) evalin('caller', [script ';']); }

More Answers (0)

Products


Release

R2014b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!