Why 'PreserveFormat' in writetable returns error?

10 ビュー (過去 30 日間)
Joanna Przeworska
Joanna Przeworska 2021 年 4 月 9 日
編集済み: Walter Roberson 2021 年 4 月 9 日
Hi,
I have a code:
writetable(SECTORS.NFC.Total,'Wyniki_2020_12.xlsx','Sheet','NFC','Range','B9:L77','PreserveFormat',true,'WriteVariableNames',0)
and my goal is to save table in Excel spreadsheet without changing the format of rows and columns. I found, within writetable command, I may use 'PerserveFormat' however it returns an error:
Error using writetable (line 152)
Invalid parameter name: PreserveFormat.
How can I correct my code?

採用された回答

Stephen23
Stephen23 2021 年 4 月 9 日
編集済み: Stephen23 2021 年 4 月 9 日
The 'PreserveFormat' option was added in R2020b:
You are probably using an earlier version which does not support that option. If you add the version number (see the field on the right of this page) when you ask a question then we do not have to guess what version you are using.
Note that although the online documentation is very interesting to read, to know what your installed MATLAB version is capable of you should refer to the help of your installed MATLAB.
  3 件のコメント
Stephen23
Stephen23 2021 年 4 月 9 日
"Is there any other simple way to achieve this goal?"
I do not know of any simple alternative.
Walter Roberson
Walter Roberson 2021 年 4 月 9 日
編集済み: Walter Roberson 2021 年 4 月 9 日
For those older versions, you have to use MS Windows with Excel installed and use ActiveX to talk to Excel.
Or you have to get down into the insides of the xlsx file, find the XML sheet that holds the format information, and insert it into the newly written xlsx file (or something along those lines.)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by