Open an xls file

3 Ansichten (letzte 30 Tage)
Maria Grazia Di Giorgio
Maria Grazia Di Giorgio am 15 Dez. 2020
Beantwortet: Shashank Arya am 17 Dez. 2020
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 Kommentar
Ive J
Ive J am 15 Dez. 2020
Just out of pure curiosity, why don't you use readtable?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Shashank Arya
Shashank Arya am 17 Dez. 2020
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

Kategorien

Mehr zu Use COM Objects in MATLAB finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by