Open an xls file

조회 수: 5 (최근 30일)
Maria Grazia Di Giorgio
Maria Grazia Di Giorgio 2020년 12월 15일
답변: Shashank Arya 2020년 12월 17일
Hi everyone,
I'm trying to open an excel file with actxserver function in Matlab R2019a.
The command line written are:
A = actxserver('Excel.Application');
B= A.workbooks.Open(strFilePath);
We are able to read the Excel file only in some PC, not in all.
The Open function is suggested by Matlab, but it doesn't work. What could be the problem?
  댓글 수: 1
Ive J
Ive J 2020년 12월 15일
Just out of pure curiosity, why don't you use readtable?

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

답변 (1개)

Shashank Arya
Shashank Arya 2020년 12월 17일
Hi,
From my understanding, you want to open an excel file using the actxserver function, which works in specific machines but not all.
I am assuming, this does not works for you in PC, but not in MAC.
MATLAB does not support COM functions on MAC since COM is Microsoft technology, and available only on Windows.
An easier alternative for you would be to use readtable function available in MATLAB, which creates a table by reading column-oriented data from a file.
Refer to the below link to access readtable documentation
Thanks and Regards,
Shashank Arya

카테고리

Help CenterFile Exchange에서 Use COM Objects in MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by