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

InsertRow / DeleteRow / InsertColumn / DeleteColum do not update formulas on other sheets #12

Closed
JanKallman opened this issue Feb 6, 2020 · 2 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@JanKallman
Copy link
Contributor

JanKallman commented Feb 6, 2020

To reproduce:

        [TestMethod]
        public void DeleteIssue()
        {
            using (var p = new ExcelPackage())
            {
                var ws1 = p.Workbook.Worksheets.Add("Sheet1");
                var ws2 = p.Workbook.Worksheets.Add("Sheet2");
                ws1.Cells["A10"].Value = 1;
                ws1.Cells["A11"].Formula = "A10*2";
                ws1.Cells["A12"].Value = 3;
                ws2.Cells["A1"].Formula = "SUM(Sheet1!A10:A12)";
                ws1.DeleteRow(1);
                Assert.AreEqual("A9*2",ws1.Cells["A10"].Formula);
                Assert.AreEqual("SUM(Sheet1!A9:A11)",ws2.Cells["A1"].Formula);
            }
        }
JanKallman added a commit that referenced this issue Feb 19, 2020
@JanKallman JanKallman self-assigned this Feb 19, 2020
@JanKallman JanKallman added bug Something isn't working enhancement New feature or request labels Feb 19, 2020
@JanKallman
Copy link
Contributor Author

EPPlus did not update formula references for cross-sheet addresses. This commit updates the behavior methods InsertRow / DeleteRow / InsertColumn / DeleteColum.
DeleteRow and DeleteColumn will now set deleted cells in a formula to #REF! if fully deleted or shrink the addresses if partial deleted.

@JanKallman
Copy link
Contributor Author

EPPlus RC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant