Why does MATLAB change the format of cells?
1 view (last 30 days)
Show older comments
Hello,
I'm currently using MATLAB to import, calculate, then export some data from/to an Excel workbook.
I'm using actxGetRunningServer() all along the process.
Nevertheless, when saving the workbook and re-opening it later, many cells are changed in a "custom" format, that then have to be changed back on all sheets...
Does someone now why it occurs? Maybe be before saving and closing the Excel, there would be a finishing call to do to close properly the interaction?
Thank you in advance, and have a nice day,
Eric
3 Comments
Guillaume
on 18 Dec 2018
You've already gone to the trouble of writing your own automation code. I would go the whole way and do the reading and writing myself rather than relying on these xlsread1 and xlswrite1 which frankly are of poor quality (the use of evalin on the the first line, and the fact that the function validates the file input to then never use it are disturbing).
However, I don't think the functions are responsible for your problem. The data insertion is fairly basic and shouldn't affect the formatting. To understand what is happening, it would be useful to have a spreadsheet before the data insertion, the data that you insert (in a mat file) and the range at which you insert it. The incorrect after spreadsheet would be useful as well.
Also, which version of excel are you using?
Answers (0)
See Also
Categories
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!