.xlsx files are .zip files that contain directories and a series of different .xml files, including information about the different worksheet names.
The routine to parse the worksheet names is expecting that the XML will look like similar to
<sheet name="sheet1" sheetId="1" r:id="rId1"/>
but instead in that file it looks like
<sheet name= "sheet1" sheetId="1" r:id="rId1"/>
notice the space between the = and the " that follows it.
I do not know enough about the XML standards to know whether a space there is permitted or not, but what we do know is that in those files the space is there . And so whether it is "proper" or not, we can hack around that part of the problem fairly easily.
edit( fullfile(toolboxdir('matlab'),'iofun','private','getSheetNames.m') )
and head to line 19, which will have
match = regexp(workbook_xml, '<sheet[^>]+name="(?<sheetName>[^"]*)"[^>]*r:id="(?<rid>[^>]+?)"[^>]*/>|<sheet[^>]*r:id="(?<rid>[^>]+?)"[^>]*name="(?<sheetName>[^"]*)"[^>]*/>', 'names');
Change that to
match = regexp(workbook_xml, '<sheet[^>]+name=\s*"(?<sheetName>[^"]*)"[^>]*r:id="(?<rid>[^>]+?)"[^>]*/>|<sheet[^>]*r:id="(?<rid>[^>]+?)"[^>]*name=\s*"(?<sheetName>[^"]*)"[^>]*/>', 'names');
And save the file. You should then be able to xlsinfo() the file.
(You might need to do a "rehash toolboxcache", maybe)
However, more is needed to be done to xlsread() the file. It appears the xml does not have a dimension declaration; I will need to investigate how to deal with that.
Best Answer