Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrupted after calling ShiftRows function to remove the row where the shared formula is defined #1490

Open
26642523 opened this issue Feb 14, 2025 · 0 comments
Labels

Comments

@26642523
Copy link

26642523 commented Feb 14, 2025

NPOI Version

2.7.2

File Type

  • XLSX

Upload the Excel File

Please attach your original Excel File to help us reproduce the issue

import.xlsx

Reproduce Steps

Create a project, and paste the code below.

static void Main(string[] args)
{
string filename = "import.xlsx";
IWorkbook doc = new XSSFWorkbook(filename);
int insertRow = 2;
var sheet = doc.GetSheetAt(0);

sheet.ShiftRows(insertRow, sheet.LastRowNum, -1);
using (var ms1 = File.OpenWrite("out.xlsx"))
{
    doc.Write(ms1, false);
}
doc.Close();

}

Issue Description

after calling the ShiftRows function, the output file will be corrupted due to the invalid shared formula.

@26642523 26642523 added the bug label Feb 14, 2025
@26642523 26642523 changed the title Corrupted after calling ShiftRows function Corrupted after calling ShiftRows function to remove the row where the shared formula is defined Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant