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

조회 수: 5 (최근 30일)
Ray Morton-Ewbank
Ray Morton-Ewbank . 2018년 7월 16일
답변: Corey Silva . 2018년 7월 16일
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 ';']); }

채택된 답변

Corey Silva
Corey Silva 2018년 7월 16일

추가 답변 (0개)


Help CenterFile Exchange에서 Data Export to MATLAB에 대해 자세히 알아보기




Community Treasure Hunt

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

Start Hunting!

Translated by