writecell messes up merge and center when writing to Excel
17 views (last 30 days)
Show older comments
Matt C on 24 Mar 2021
Commented: Mikel Arrinda on 31 Mar 2023
I tried to switch some of my old xlswrite functions over to writecell as this newer function seems superior in terms of efficiency, however I found that when writing data to cells that have already been merged and centered in an Excel file, writecell wipes out the merge/center. In fact, it seems like writecell wipes other formatting as well (column widths are resized to fit the data). This is pretty annoying as I am just trying to write cell data in specific cells without altering the formatting of the file.
xlswrite does not have this issue. It just puts the data in there.
Any workarounds that don't involve activexserver would be appreciated. At a minimum I would like to understand why this is happening.
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!