Cannot read xls files

17 views (last 30 days)
Cécile Moulin
Cécile Moulin on 12 Dec 2016
Commented: Image Analyst on 13 Dec 2016
Hi,
I'm trying to read a xls file with Matlab (2015b, used in the lab, on a host). I have the following error :
Error using xlsread (line 251)
XLSREAD unable to read sheet 'tab1'.
File could not be read by biffparse. Invalid record ID.
with the command :
xlsread('fichier_test.xls','tab1');
And when I try to write, I have :
Warning: Could not start Excel server for export.
XLSWRITE will attempt to write file in CSV format.
I'm quite lost... Thank you Ccile
Sorry for the mistakes.
EDIT
Hi,
I don't know if it's better to edit my post or to post an answer so I do both.
I think I found the reason of the error (in my case) : I had a " ' " in the file. I removed it and it was good ^^ Now I just need to check if it's good on the "Monday's Matlab" (I work in two labs...) (no more answer on Monday means it's good ^^)
Thanks for reading, sorry for the mistakes (do not hesitate to correct... by contact if you prefer)
Ccile
PS How do I close this question ?
  1 Comment
Image Analyst
Image Analyst on 13 Dec 2016
I don't think that a ' in any cell of Excel should cause xlsread() to throw an error. Is the xls file you attached the one with the ' in it or not? If so, exactly where is the ' -- in a cell, or a sheet name or where???

Sign in to comment.

Answers (3)

Image Analyst
Image Analyst on 12 Dec 2016
You forgot to attach xls_file.xls.
Failing that, about all I can suggest is to not use the 'tab1' argument, or try 'Sheet1' or whatever the worksheet is really called.

Isabella Osetinsky-Tzidaki
see https://www.mathworks.com/matlabcentral/answers/100550-why-does-xlsread-return-errors-with-some-spreadsheets-on-non-windows-platforms-in-matlab-7-6-r2008a

Cécile Moulin
Cécile Moulin on 13 Dec 2016
Edited: Cécile Moulin on 13 Dec 2016
Hi,
I don't know if it's better to edit my post or to post an answer so I do both.
I think I found the reason of the error (in my case) : I had a " ' " in the file. I removed it and it was good ^^ Now I just need to check if it's good on the "Monday's Matlab" (I work in two labs...) (no more answer on Monday means it's good ^^)
Thanks for reading, sorry for the mistakes (do not hesitate to correct... by contact if you prefer)
Ccile
PS : how do I close this question ?

Tags

Community Treasure Hunt

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

Start Hunting!