Questions tagged [closedxml]

ClosedXML is a .NET library for reading, manipulating and writing Excel 2007+ (.xlsx, .xlsm) files.

ClosedXML is a .NET library for reading, manipulating and writing Excel 2007+ (.xlsx, .xlsm) files. It aims to provide an intuitive and user-friendly interface to dealing with the underlying OpenXML API.

ClosedXML provides a object oriented way to manipulate Excel 2007+ (.xlsx, .xlsm, etc) files (similar to VBA) without dealing with the hassles of XML Documents. It can be used by any .NET language like C# and Visual Basic (VB).

Online resources:

615 questions
0
votes
1 answer

Error while saving modified excel(xlsx) file with ClosedXML

I am trying to add title rows on an existing excel file (xlsx) with ClosedXML library and following code: public void HandlePrintTitleRows(IList sheetIndex) { using (_workbook = new XLWorkbook(_filePath)) { foreach (var i in…
ajr
  • 874
  • 2
  • 13
  • 29
0
votes
0 answers

Formatting date column while generating excel using closedxml when columns are dynamic

While generating excel from datatable using closedxml how to format date columns when columns are dynamic? that is datatable may not consist date column or if consist then can be on any index?
Ronny
  • 1
0
votes
3 answers

Delete Multiple Cells with ClosedXML

I have to remove empty Cells from Excel Sheets. We using to create and edit files ClosedXML. Example Excel-Before: XX XX XX XX XX XX XX XX XX XX XX XX XX XX …
0
votes
1 answer

Create Excel Data Table in ClosedXML C# from existing Data

I am trying to convert the data I already have in a Worksheet in to a DataTable using ClosedXML but I cannot find an overload method for what I need. This is the code that I am trying: NewWorksheet.Cell(1, 1).InsertTable(); The closest overload…
djblois
  • 963
  • 1
  • 17
  • 52
0
votes
1 answer

Adding datatype to table columns with ClosedXML

I'm using ClosedXML to create an xlsx-file with some data. In the Excel-sheet I have a table with data. In the columns of the table (not the column of the sheet) I want to specify datatypes. /* This datatable is created and populated…
0
votes
1 answer

ClosedXML when Working With Conditional Formats using formulas - the formula is incorrect

I am using conditional formatting with ClosedXML and I am having 2 issues with it. First, if I set the condition to be based on a value like so: >…
Daniel Blois
  • 187
  • 1
  • 1
  • 7
0
votes
1 answer

Not able to read excel sheet saved as xls using closedxml

I have the below code to save the data in excel sheet as .xls public ActionResult ExportToExcel() { DataTable tbl = CopyGenericToDataTable(res); tbl.TableName = "InvalidInvoices"; using (XLWorkbook wb = new…
Nadeem Shaikh
  • 362
  • 5
  • 23
0
votes
1 answer

How do I get the number of rows used by the merged cells in Excel, using ClosedXml and C#

As an overview I am currently exporting data from my database and exporting it to an excel sheet. I have formatted some of the cells (i.e Merged cells etc) in the excel sheet using ClosedXml, now I am little stuck with a small issue which I can get…
sanktify
  • 65
  • 1
  • 8
0
votes
1 answer

Filling out a complex Excel template from ASP.NET MVC (C#) with OpenXML/ClosedXML/NPOI

I am developing an application which must produce a complex well-formatted Excel report. I have previously successfully used OpenXML for filling in PowerPoint and Word templates by first reflecting code with OpenXML Productivity Tool and then…
Bobby
  • 13
  • 1
  • 5
0
votes
0 answers

How to Create calendar control in Excel cell using closedXML dll and c#?

We have Download excel template option in our asp.net web application. In that excel template sheet, We should show the calendar control on one of the column to select the date & time values in that column cell. We have done drop down control into…
Kavin
  • 303
  • 2
  • 14
0
votes
1 answer

How to set DateTimePicker in worksheet column with closedxml.dll

I have used the closedxml.dll for generating worksheet. I have an application where on click of button saves some data in Excel using C#.I have used the memorystream for saving inside the excel sheet. I have also kept dropdown for some columns…
charan tej
  • 1,054
  • 10
  • 29
0
votes
1 answer

Excel Interop Open/Repair HResult exception

What I do: populate & format an Excel file using a mix of Interop and ClosedXML. First, the file is populated via Interop, then saved, closed, then I format the cells' RichText using ClosedXML. Unfortunately, this formatting causes Excel to view my…
LocEngineer
  • 2,847
  • 1
  • 16
  • 28
0
votes
0 answers

Caught ThreadStateException when using SaveFileDialog

I got a problem with SaveFileDialog. The background is that I want to Export the data from a GridView to an Excel File. I am using ClosedXML for that, but the problem is that the file is directly exported to a assigned folder. Meanwhile, I need a…
0
votes
1 answer

C# Open XML SDK write data at specific cell reference

I have an excel sheet with a cell with a changed cell reference. With my code, i can load the excel sheet and load my data into it. But i want that my data will begin insert at the specific Cell "int_startdok". My Code: private byte[]…
Ryter
  • 110
  • 9
0
votes
0 answers

ClosedXML Runs Fine In Visual Studio but not on Server When Published

I have a web site that is using ClosedXML to create Excel Files. When I publish it will not run. I am getting no error messages, but it seems not to run. Dim dt As New DataTable dt = Session("excelDataTable") Dim wb As New…
dindryte
  • 46
  • 8