Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Created November 11, 2022 15:32
Update Excel Files Using .NET
Workbook wkb = new Workbook("sourceFile.xlsx");
Cell cellWithData = wkb.Worksheets[0].Cells["A1"];
cellWithData.Value = 100;
Cell cellWithFormula = wkb.Worksheets[1].Cells["C1"];
cellWithFormula.Formula = "=Sum(A1,A20)";
wkb.CalculateFormula();
Worksheet sheet = wkb.Worksheets[1];
Cell cell = sheet.Cells["A1"];
cell.PutValue("Hello World!");
wkb.Save("modified-targetfile.xlsx");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment