readtable successful on .xlsx file but fails on .xlsb file

조회 수: 7 (최근 30일)
RM
RM 2023년 5월 4일
댓글: RM 2023년 5월 4일
readtable works fine reading an .xlsx file, but hangs when reading an .xlsb file.
The following works perfectly:
dat = "C:\DataDirectory\DataFile.xlsx";
T = readtable(dat);
I read in the documentation for readtable that for large Excle files reading the .xlsb format is recommended, so I saved the Excel file in .xlsb format and I tried:
dat = "C:\DataDirectory\DataFile.xlsb";
T = readtable(dat);
but this opens the Excel file and then freezes both Excel and Matlab. The only way to recover was to end the Excel process via TaskManager.
Matlab version is 2019b.
Excel version: Microsoft® Excel® for Microsoft 365 MSO (Version 2302 Build 16.0.16130.20374) 32-bit
I can continue to work with the .xlsx format, but I'm still curious if I'm doing something wrong, or if there is a known issue. It would be nice to use the .xlsb format if it in fact loads faster.

답변 (1개)

Cris LaPierre
Cris LaPierre 2023년 5월 4일
편집: Cris LaPierre 2023년 5월 4일
No, you are not doing anything wrong. *.xlsb files are officially supported in readtable in R2019b.
readtable determines the file format from the file extension:
  • .txt, .dat, or .csv for delimited text files
  • .xls, .xlsb, .xlsm, .xlsx, .xltm, .xltx, or .ods for spreadsheet files
How were your xlsb files created? Can you attach one to your post for others to test?
You might consider adding the 'UseExcel' flag.
dat = "C:\DataDirectory\DataFile.xlsb";
T = readtable(dat,'UseExcel',true);
  댓글 수: 3
Cris LaPierre
Cris LaPierre 2023년 5월 4일
If your information is confidential, then I suggest working directly with support. You can reach out to them here: https://www.mathworks.com/support/contact_us.html
RM
RM 2023년 5월 4일
Thanks. I'll do that.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by