Excel (.csv) error: "Excel Worksheet could not be activated.""
조회 수: 3 (최근 30일)
이전 댓글 표시
I am trying to read a column from a csv file.
filename = 'sample.csv';
Longitude = xlsread(filename,'D:D');
when I execute these lines, I get an error that says "Excel Worksheet could not be activated". This error does not accur when I reduce the number of rows in the sheet to 100 (originally it has ~400,000 rows). Does this problem occur because of the large number of rows? Is there a way around it?
댓글 수: 1
Easwar Kumar Yarrabikki
2019년 3월 14일
I faced this issue when I ignored an MS Office update for several days. Once I have updated and MS office and restarted my machine issue got resolved. Also make sure your MS Office account is also up to date.
답변 (1개)
Bob Thompson
2019년 3월 14일
A .csv file is not actually an excel format, although it can be opened with excel. I would suggest using csvread() instead, as it allows you to work directly with the proper format.
I believe it is possible to load .csv files directly with xlsread, however, you are not able to specify which sheet should be used (because .csv files cannot have multiple sheets), and specifying the range is not going to follow the same format (because .csv files do not have letter designated columns).
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!