tfussell / xlnt

:bar_chart: Cross-platform user-friendly xlsx library for C++11+
Other
1.49k stars 418 forks source link

multiple sheets bug #476

Open christopherwoo opened 4 years ago

christopherwoo commented 4 years ago

I open an xlsx file which is normal, do nothing, then save it. It run successfully. But the output xlsx file can't be opened correctly. Same recover error just like #365.

Here is the code:

int main()
{
        xlnt::workbook wb;
        wb.load("excelCopy.xlsx");
        wb.save("result.xlsx");
        return 0;
}

I examine sheet_format_properties() of every sheet. The default_column_width and default_row_height is not the same from each other.

I can not do other operation right while this problem exists.

How to fix it?

christopherwoo commented 4 years ago

The "excelCopy.xlsx" file I used: excelCopy.xlsx

christopherwoo commented 4 years ago

My Environment: Windows 10 + VS 2015 + Excel 2016 + latest xlnt Refer to #120, maybe it's just a windows quirk.

tfussell commented 4 years ago

Thanks for reporting this. I will attempt to reproduce and report back.

ghost commented 4 years ago

Yes, I got a bug too. I just opened the file and saved it immediately. The new file is created damaged. You can immediately see that the saved file is smaller in size than the read file. Windows 10+VS2017+Excel 2013.