Error when using readtable!
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Error using readtable (line 197)
Unable to open file '/Users/debbieoomen/Desktop/Data Files/ActiGraphTemplateDiary.xlsx' as a workbook. Check that
the file exists, read access is available, and the file is a valid spreadsheet file.
Error in ReadDiary (line 8)
diaryfile = readtable(DiaryFile)
This code worked yesterday. However, I have changed one or two things in the sheet on my MacBook (which shouldn't be an issue). Now I keep on getting this error.
[DiaryFile,DiaryFolder] = uigetfile({'*.xls;*.csv;*.txt;*.xlsx'});
if isequal(DiaryFile,0);
ErrorDiaryfile = msgbox('No diary file selected', 'Error','error');
return
else
addpath(DiaryFolder)
diaryfile = readtable(DiaryFile)
end
I have tried turning off my mac, restarting matlab and closing excel but nothing works. Not all excel files get this error but I have attached the one that does.
1 Kommentar
Matthew Esch
am 4 Mai 2018
When I went to open the "ActiGraphTemplateDiary.xls" file you included, I got a warning that the file extension did not match the file format (On Windows). I re-saved the file as "ActiGraphTemplateDiary.xlsx".
On MAC, I ran into the same error you did executing the provided code the ".xls" file, but it worked on the ".xlsx" file without issue. Try resaving the file to the more modern ".xlsx" extension and see if it resolves the issue.
Antworten (0)
Siehe auch
Kategorien
Mehr zu Spreadsheets finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!