Writecell/table to Excel error

조회 수: 58 (최근 30일)
StephAud
StephAud 2026년 2월 10일 9:14
답변: StephAud 대략 19시간 전
Hi all,
I can no longer export data to Excel using writecell/table, because the function crashes due to an import issue :
Error using writetable (line 278)
Error: File: createWorkbook.m Line: 80 Column: 12
Unable to find or import 'matlab.io.spreadsheet.internal.BookType'.Imported names must end with '.*' or be fully qualified.
No problem in Matlab R2023, as it does not seem to use the same sub-functions.
Regards,
Stéphane.

채택된 답변

StephAud
StephAud 대략 12시간 전
Here is the solution from the support team, which works for me.
rehash toolboxcache
Thank you, everyone.

추가 답변 (2개)

dpb
dpb 2026년 2월 10일 16:06
이동: dpb 2026년 2월 10일 18:43
Which OS and show a sample code that fails...
tX=array2table(randn(4,3),'VariableNames',cellstr(('A':'C').'))
tX = 4×3 table
A B C _________ ________ ________ 0.07657 0.50694 -0.54845 0.99138 1.1488 0.075866 1.9897 0.99226 -1.0944 -0.074665 -0.33147 0.67604
writetable(tX,'test.xlsx')
dir
. .. test.xlsx
clear tX
readtable('test.xlsx')
ans = 4×3 table
A B C _________ ________ ________ 0.07657 0.50694 -0.54845 0.99138 1.1488 0.075866 1.9897 0.99226 -1.0944 -0.074665 -0.33147 0.67604
It functions here, of course Excel isn't available on this platform so doesn't quite match what would happen on on Windows system with Office installed.
The specific syntax complained about by the error message exists in all prior versions so something's amiss in that.
  댓글 수: 7
Walter Roberson
Walter Roberson 대략 14시간 전
편집: Walter Roberson 대략 14시간 전
No, I have /Applications/MATLAB_R2025b.app/toolbox/shared/spreadsheet/+matlab/+io/+spreadsheet/+internal but that has
Book.m getSheetNames.m
columnLetter.m readSpreadsheetFile.m
columnNumber.m selectOAuthTypeId.m
createDatetime.m Sheet.m
createGoogleSpreadsheet.m SheetType.m
createWorkbook.m SheetTypeFactory.m
dateFormats.m stringize.m
getExtension.m usedDataRange.m
getRemoteSpreadsheet.m
with no BookType.
Furthermore, when I grep through all of the binary libraries and all of the .xml and all of the source code, then only BookType is a mangled C++ symbol for _spreadsheet_mli::get_book(spreadsheet_mli::MCOSBookType*) -- so I cannot even find any reference to BookType anywhere.
StephAud
StephAud 대략 13시간 전
I have BookType.m
dir('C:\Program Files\MATLAB\R2025b\toolbox\shared\spreadsheet\+matlab\+io\+spreadsheet\+internal\')
. SheetTypeFactory.m dateFormats.m stringize.m
.. columnLetter.m getExtension.m usedDataRange.m
Book.m columnNumber.m getRemoteSpreadsheet.m
BookType.m createDatetime.m getSheetNames.m
Sheet.m createGoogleSpreadsheet.m readSpreadsheetFile.m
SheetType.m createWorkbook.m selectOAuthTypeId.m

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


Fangjun Jiang
Fangjun Jiang 대략 1시간 전
You might have a different writetable.m
>> which -all writetable.m
C:\Program Files\MATLAB\R2025b\toolbox\matlab\io\tabular\iofun\writetable.m
C:\Program Files\MATLAB\R2025b\toolbox\matlab\bigdata\@tall\writetable.m % tall method
C:\Program Files\MATLAB\R2025b\toolbox\parallel\array\distributed\@codistributed\writetable.m % codistributed method

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

제품


릴리스

R2025b

Community Treasure Hunt

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

Start Hunting!

Translated by