Why does XLSREAD return errors with some spreadsheets on non-Windows platforms in MATLAB 7.6 (R2008a)?
6 次查看(过去 30 天)
显示 更早的评论
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.
采纳的回答
MathWorks Support Team
2009-6-27
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 个评论
madhan ravi
2018-3-19
even I have the same problem with 2017a Matlab for Mac OS , could you guide please?
Walter Roberson
2018-11-22
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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!