Why does XLSREAD return errors with some spreadsheets on non-Windows platforms in MATLAB 7.6 (R2008a)?
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 27 de Jun. de 2009
Comentada: Walter Roberson
el 22 de Nov. de 2018
I am attempting to use XLSREAD to import data from an Excel file on MAC OS 10.5, but have been unsuccessful. On executing XLSREAD on a certain XLS-file, I see several lines in the MATLAB Command Window that read as follows:
Skipping 16 bytes of extended strings
Skipping 16 bytes of extended strings
Skipping 16 bytes of extended strings
[snip]
Before generating one of the following errors:
??? Specified worksheet was not found
or
??? File could not be read by biffparse. Invalid record ID.
However, the same syntax will work on a Windows machine. I have also tried using the 'basic' mode with no success.
Respuesta aceptada
MathWorks Support Team
el 27 de Jun. de 2009
The ability to unrestrictedly import data from all Microsoft Excel formats using the 'basic' mode is not available in MATLAB 7.6 (R2008a).
As stated in our documentation: The full functionality of XLSREAD depends on the ability to start Excel as a COM server from MATLAB. If your system does not have this capability (as on a non-Windows platform such as a Mac or Linux machine), the XLSREAD syntax that passes the 'basic' keyword is recommended. As long as the COM server is available, you can use XLSREAD on Excel files having formats other than XLS (for example, HTML).
Unfortunately, due to the evolving nature of Microsoft Excel file formats, it is difficult to have the 'basic' mode (which invokes the private function BIFFPARSE) support all possible Excel formats. Therefore, this mode has some fundamental limitations.
In order to work around this issue, save all errant XLS-files in Microsoft Excel 95 format. This ensures that all unsupported formatting is eliminated from the file, thus rendering it readable by the XLSREAD function in 'basic' mode.
2 comentarios
madhan ravi
el 19 de Mzo. de 2018
even I have the same problem with 2017a Matlab for Mac OS , could you guide please?
Walter Roberson
el 22 de Nov. de 2018
Alternatives for Mac and Linux:
- Use readtable()
- Use OfficeLibre or similar to open the file and safe a copy as Office 95 compatible
- Use Virtual Machine software such as Wine or Parallels to run an instance of MS Windows with MATLAB and Excel installed and command the virtual machine to do the reading for you and transfer it over to the Mac / Linux instance.
Más respuestas (0)
Ver también
Categorías
Más información sobre Spreadsheets en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!