MATLAB Answers

Web app not able to perform xlsread/xlswrite

10 ビュー (過去 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.

  0 件のコメント

Sign in to comment.

回答 (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

Sign in to comment.


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 日
I meant something like
data = xlsread('C:\Data\myfile.xlsx');
instead of
data = xlsread('myfile.xlsx');
Titus

Sign in to comment.


srinu siliveru
srinu siliveru 2019 年 3 月 16 日
thank you very much.
i will try

  0 件のコメント

Sign in to comment.


srinu siliveru
srinu siliveru 2019 年 3 月 16 日
Thanks a lot sir
it worked.

  0 件のコメント

Sign in to comment.


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

Sign in to comment.


Translated by