Filter löschen
Filter löschen

why my excel file can not be read by matlab?

169 Ansichten (letzte 30 Tage)
Milad
Milad am 5 Mai 2016
Beantwortet: Elson Leung am 27 Mär. 2023
I have simple excel file including date and rainfall in two columns. the matlab can not read the file, either import data by xlsread command. I made two format .xls and .xlsx. but matlab has an error. just it can read .csv file. matlab version is 2016a. error message after command Error using xlsread (line 251) Error: The server threw an exception.
  3 Kommentare
zhuyuan
zhuyuan am 16 Mär. 2022
really? i restart three times at least, but no use.
Image Analyst
Image Analyst am 16 Mär. 2022
@zhuyuan you probably have a hidden Excel server running that just retarting MATLAB won't get rid of. You have to restart your computer, or else if you're using WIndows type control-shift-Esc (to bring up the task manager) and kill it there.

Melden Sie sich an, um zu kommentieren.

Antworten (3)

Milad
Milad am 5 Mai 2016
Bearbeitet: Milad am 5 Mai 2016
Who has problem to read excel file, can follow this order. 1- open the excel> file, >option, >add in, manage then select COM ADD IN, and clear everything (unchecked). everything should be cleared (unchecked).
2- restart the PC, and open the matlab. 3- perform xlsread command.
NOTE: for those people who use foxit pdf reader, it is potential to face this problem, so follow mentioned order.
NOTE: sometimes by using the matlab, configuration of excel is changed in unknown way, therefore there is no way to open the usual excel file in windows by double click.
So, open excel from desktop icon, file> option,> advanced,> general and then make clear (unchecked) "the ignore applications that use dynamic data exchange (DDE)". (same information for NOTE 2: https://support.microsoft.com/en-us/kb/3001579) these are some error for excel worker with matlab and related command.
  7 Kommentare
S Deligeorges
S Deligeorges am 31 Mär. 2021
Thank you for the post, it partially solved the problem for me. I was able to open the file once with xlsread, the moment I read the data, the error returned and I can no longer read the data file and get the line 257 error. COM ADD IN unchecked already, can't use the same trick again.
Shahrulnizahani Mohammad Din
Hi. I am facing the same prpblem.
Toubleshoot efforts:
1) clear (unchecked) the COM Add-in, clear (unchecked) "the ignore applications that use dynamic data exchange (DDE) and restarted the laptop...open MATLAB and try run it..[result : no success]
2) uninstall and re-install MATLAB and retarted the laptop..open MATLAB and try run it..[result : no success]
3) try ti change the xlsx file to xls, open MATLAB and try run it...[result : no success]
4) the the file path and filename (to check typo error)..evertything is in place
5) changed the location (from Dropbox to My Document folder) , reopen MATLANB and try to run the code [result : no success]
6) change xlstead to readtable/ read matrix [result : no success]
Pls help
thanks

Melden Sie sich an, um zu kommentieren.


Image Analyst
Image Analyst am 5 Mai 2016
Try using readtable() instead
t = readtable('whatever.xlsx');

Elson Leung
Elson Leung am 27 Mär. 2023
Well I am facing the same issue there, I've tried readtable, readmatrix and the rest of possible solution. All of them didnt work.
But the obvious solution is close the excel first, MATLAB apparently cannot read excel while it is opened.

Community Treasure Hunt

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

Start Hunting!

Translated by