Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenXML add new row to existing Excel file [closed]

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 ?

like image 843
james Avatar asked Jul 12 '11 13:07

james


People also ask

How to update Excel Using OpenXml c#?

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);

Does OpenXml support XLS?

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.

How do I make text bold in OpenXml?

Bold fbld = new Bold();


1 Answers

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);
like image 184
Janis S. Avatar answered Sep 22 '22 12:09

Janis S.