Web app not able to perform xlsread/xlswrite

조회 수: 1 (최근 30일)
Giulio Francesca
Giulio Francesca 2018년 7월 29일
댓글: srinu siliveru 2019년 3월 21일
I've compiled a web application with matlab web app compiler. In my code I use both .mat files and .xlsx files which are located in the same folder. While my program is able to access .mat files without any error, xlsx files are not accessible returning the error: Excel couldn't find the specified file. However, when run in matlab environment I do not receive this error. The error appears when I try to run the app from my web server.

답변 (5개)

Titus Edelhofer
Titus Edelhofer 2018년 7월 30일
Hi Giulio,
have you tried to first build up the full path to the Excel file? So instead of only the file name provide the full path?
Titus
  댓글 수: 1
Giulio Francesca
Giulio Francesca 2018년 8월 1일
Hi Titus, thanks you for your reply. I realize that the problem could be related xlsread function which uses the 'basic' mode when adopted into a web application. Anyway, I'm not sure about that because sometimes it works, other is not

댓글을 달려면 로그인하십시오.


srinu siliveru
srinu siliveru 2019년 3월 15일
hi Titus, can you please explain with a example.
thank you
  댓글 수: 1
Titus Edelhofer
Titus Edelhofer 2019년 3월 15일
편집: Titus Edelhofer 2019년 3월 15일
I meant something like
data = xlsread('C:\Data\myfile.xlsx');
instead of
data = xlsread('myfile.xlsx');
Titus

댓글을 달려면 로그인하십시오.


srinu siliveru
srinu siliveru 2019년 3월 16일
thank you very much.
i will try

srinu siliveru
srinu siliveru 2019년 3월 16일
Thanks a lot sir
it worked.

srinu siliveru
srinu siliveru 2019년 3월 16일
Will it works if i want to use the .exe file in another sytem because path will change
can you please help me how to handle that.
thanks in advance
  댓글 수: 2
Titus Edelhofer
Titus Edelhofer 2019년 3월 18일
Hi,
you might use the function isdeployed to distinguish:
if isdeployed
% read from folder A on system where exe runs
else
% read from folder B on your development system
end
Titus
srinu siliveru
srinu siliveru 2019년 3월 21일
hi Titus
Thank you for helping
srinu

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB Web App Server에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by