umya-spreadsheet
umya-spreadsheet copied to clipboard
Corrupt comments
I'm not sure whether or not this was an issue in previous version, not sure whether I had tested with Excel.
Opening a file with comments in excel makes excel complain about problems. Allowing it to recover makes it say that comments were a problem and they were removed.
This was working in ODS with 0.2.0 unsure whether it does with 0.2.1.
Thank you for contacting us. We will investigate the cause.
Finally checked this. Comments do work in LibreOffice Calc
I could not reproduce the error here. Hmmm, maybe it depends on the Excel version.
I also encountered a similar problem.
how to reproduce
create the xlsx file
Download WPS office from it's official website. WPS office is a very popular office software in China that has similar functionalities as Microsoft Office.
Then create a new workbook, create a new worksheet, insert any text in a new cell, and insert comment to the cell, save it as "wps_comment.xlsx".
run the code
run the following code to open and save the xlsx file as "wps_comment_corrupted.xlsx"
use std::path::Path;
use umya_spreadsheet::{Spreadsheet, Worksheet};
// umya_spreadsheet version = 1
fn main() {
let xlsx_path = Path::new("./wps_comment.xlsx");
let mut wb = umya_spreadsheet::reader::xlsx::read(xlsx_path).unwrap();
// save to new file
let parent = xlsx_path.parent().unwrap();
let new_file = parent.join("wps_comment_corrupted.xlsx");
umya_spreadsheet::writer::xlsx::write(&wb, &new_file).unwrap();
}
use Microsoft Office to open the "wps_comment_corrupted.xlsx"
Note that at this step, you need to use Microsoft Office to open the "wps_comment_corrupted.xlsx" file. If you use WPS Office to open it, no problem will happen. It will show warnings that the some content is problematic. Upon closing the first dialog, a new dialog will be opened showing that "Removed Part: /xl/drawings/vmlDrawing1.vml part. (Drawing shape)".
why use both Microsoft Office and WPS Office
Because in China, a lot of people use WPS Office, and other people use Microsoft Office. So MS Office people very often have to edit excel files received from other people that may be using WPS Office.
related file
You can find attached a "wps_comment.xlsx" file created by me for quick testing.
@wellitecho Thank you for your report. I have confirmed that the error occurs in my environment as well. We will address this in the next version of the software.
@wellitecho We have completed our response to this matter. Please check the latest version.
Thank you for your hard work. I tested with version 1.0.1, and the problem is solved.
Thank you. @MathNya