matlab xlsread fails under windows autosys; how can I make it work?
3 views (last 30 days)
Show older comments
Ray Morton-Ewbank
on 16 Jul 2018
Answered: Corey Silva
on 16 Jul 2018
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 ';']); }
0 Comments
Accepted Answer
Corey Silva
on 16 Jul 2018
Hi Ray,
Try taking a look at this: Why do I get an error when using XLSREAD in a BATCH job submitted to a Windows cluster managed by MathWorks Job Scheduler in MATLAB Distributed Computing Server 6.0 (R2012a)?
I have a feeling it may be related to your description.
0 Comments
More Answers (0)
See Also
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!