Prashant Singh
Prashant Singh

Reputation: 111

Gitlab CI, Matlab - Unable to read xls through Matlab while fired from Gitlab CI

I am trying to fire following command through gitlab-ci.yml :

C:\MATLABR2016b\bin\matlab.exe -wait -r "try; clear; [~,text,~]=xlsread('Model\TestCase1.xlsx'); catch e; disp('Error building model '); disp(e.message); exit(1); end; disp('PASS'); exit(0);" -logfile log.txt exit;'

Matlab starts as a background process. Creates a log, but following error is encountered:

"Error building model Calling error, exception dispatching: Source: Microsoft Excel Explanation: The file 'C: \ gitlab \ test \ SampleTestProject \ TestFolder \ Model \ Testcase1.xlsx' can not be accessed. One of the following reasons is considered.

• The file name or path does not exist. • The file is being used by another program. • A workbook with the same name as the workbook you are trying to save is currently open. Help file: xlmain11.chm Help context ID: 0"

Tried restarting the pc, checking if the file is already open, endind excel processes in task manager. But nothing works!

Upvotes: 1

Views: 596

Answers (1)

Prashant Singh
Prashant Singh

Reputation: 111

I found the issue. I was running gitlab runner using command "git-runner.exe start" due to which it is starting in non-Desktop interacting mode. To resolve the issue, started it as "git-runner.exe run" and the issue resolved

Upvotes: 1

Related Questions