Skip to content
This repository has been archived by the owner on Nov 24, 2020. It is now read-only.

Cannot update file - error in a saved excel file #184

Open
ghost opened this issue Oct 9, 2020 · 0 comments
Open

Cannot update file - error in a saved excel file #184

ghost opened this issue Oct 9, 2020 · 0 comments

Comments

@ghost
Copy link

ghost commented Oct 9, 2020

Create empty the Microsoft xlsx file "tmp.xlsx". Use the code below:

XSSFWorkbook xssWorkbook = null;

using (var stream = new FileStream(@"C:\temp\tmp.xlsx", FileMode.Open, FileAccess.Read))
{
    xssWorkbook = new XSSFWorkbook(stream);
}

using (var stream = new FileStream(@"C:\temp\tmp2.xlsx", FileMode.Create, FileAccess.Write))
{
    xssWorkbook.Write(stream);
}

Open the "tmp2.xlsx" file - you will see the below error:

-

Removed records: /xl/workbook.xml

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants