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)?

22 views (last 30 days)
I am using a Windows cluster managed by MathWorks Job Scheduler.
I have a 'xlsReadTest.m' file is a script that contains a call to XLSREAD as follows:
[numData,textData,rawData] = xlsread('Test_SR.xlsx');
numProc = numel(numData);
results = NaN(size(numData));
parfor loopProc = 1:numProc
results(loopProc) = numData(loopProc) + 20;
When I run the 'xlsReadTest.m' script as a batch job with the following command:
batch(schedObj,'xlsReadTest','Matlabpool',31,'FileDependencies', {'xlsReadTest.m','Test.xlsx'});
I obtain the following error message: ERROR: ErrorIdentifier: MATLAB:COM:E2148140012 ErrorMessage: Invoke Error, Dispatch Exception: : Source: Microsoft Office Excel : Description: Microsoft Office Excel cannot access the file '..\..\Test.xlxs'.
If I use XLSREAD in basic mode, I am able to read the data.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 25 Jul 2017
Edited: MathWorks Support Team on 25 Jul 2017
Note that XLSREAD makes use of Excel's COM Automation Server. Further, MDCS Workers typically run under the SYSTEM account on Windows systems. Unfortunately, Excel's COM Automation Server by default does not work well when called from a process running under the SYSTEM account. There are two things which you may need to configure for Excel's COM Server to work well:
1. Excel requires the profile of the user account under which it runs to have a "Desktop" directory. The SYSTEM account does not have this by default and you will need to manually create it. If working with 32-bit Excel, create:
If working with 64-bit Excel, create:
2. Depending on your Excel version you may also need to configure the COM security settings correctly:
a. Navigation to Adminstrative Tools->Component Services->MyComputer->DCOM->Microsoft Excel Application
b. Right Click on Microsoft Excel Application and select Properties
c. Click the Security tab
d. Change Launch and Activation Permissions to Customize
e. Click Edit
f.  Add SYSTEM
g. Check Local Launch and Local Activation

More Answers (0)

Community Treasure Hunt

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

Start Hunting!