readtable error "Sheet name does not exist or is not supported"

52 vues (au cours des 30 derniers jours)
JFz
JFz le 12 Juil 2018
Commenté : honggildong le 30 Juin 2021
Hi,
I use readtable all the time but never had this error until today: "Sheet name does not exist or is not supported, To check if the sheet is supported, specify the sheet by its worksheet index." Here is the way I am using it:
a = readtable(filename, 'sheet', sheetname);
If I just do a = readtable(filename), there is no error and the output a is a table with the first sheet. If I use an index, it works as well:
a = readtable(filename, 'sheet', 1);
But I need to use sheetname in this case.
What is wrong here?
Thanks for any help!
  2 commentaires
Walter Roberson
Walter Roberson le 12 Juil 2018
What is the name of the sheet in this case?
What does xlsinfo report as the available sheet names?
Meg Glade
Meg Glade le 12 Juil 2018
Do you mind sharing the exact call you are making to readtable (with filename and sheetname filled in)?

Connectez-vous pour commenter.

Réponse acceptée

JFz
JFz le 12 Juil 2018
Thanks for the help. I just fixed it! Some the date format in the sheet is not readable in Matlab. I changed the Date format in the Excel file and now it is working.
  1 commentaire
honggildong
honggildong le 30 Juin 2021
I have the exact same issue. Could you maybe explain your solution further?

Connectez-vous pour commenter.

Plus de réponses (0)

Tags

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by