I've got lots of XLSX files and I need to append a new row after the last one in the file. I'm using OpenXML and so far I know how to open/create spreadsheet, but my search for adding new rows to existing files returned nothing. Any ideas ?
Go to add references -> Right-click on it - > Click on manage nuget packages -> Browse open XML -> You will see DocumentFormat. OpenXml -> Click on install. new EnumValue < CellValues > (CellValues. String);
xls files. Excel for . NET can load and save data and formatting information in OpenXml files; however, formulas are not loaded or saved. They are copied in BIFF format as opaque.
Bold fbld = new Bold();
If you use OpenXML SDK 2.5 (Runtime) v4.0.30319 there is no Insert
method, but one can use InsertAt
instead as follows:
sheetData.InsertAt(new Row() { RowIndex = 0 }, 0);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With