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
1
vote
1 answer

ClosedXML relative range Exception in sample code

I had a problem with selecting relative range to another range inside worksheet in ClosedXML. So to be sure how it works I tried example code. var ws = wb.Worksheets.Add("Sample Sheet"); // From worksheet var rngTable = ws.Range("B2:F6"); // From…
gtu
  • 707
  • 1
  • 10
  • 22
1
vote
1 answer

Rename worksheet and its references with ClosedXML

I have renamed a Worksheet using ClosedXML and I have verified that although the sheet is renamed well, the references inside the sheet does not see the change and the excel document is corrupted. Does anyone know of any method to rename sheets…
Acubo
  • 120
  • 6
1
vote
2 answers

How to set validation for drop down in Excel using c# ClosedXML using method List(String list, Boolean inCellDropdown)

Hi All I am trying to create a dropdown list for a column in my excel using ClosedXML library. I am able to create it successfully using the below code. using (XLWorkbook wb = new XLWorkbook()) { wb.Worksheets.Add(dt); …
Gaurav Parek
  • 317
  • 6
  • 20
1
vote
0 answers

How to handle StackOverflowException in ClosedXML

I have written code to check cell formula of excel cell in C# ClosedXML. Everything works fine, but only problem is, if the checked cell formula contains self cell then it gives StackOverflowException. Can anyone please tell how to handle…
1
vote
1 answer

Write a dictionary to Excel using ClosedXML library

I have a dictionary, the key is a string, the value is a list of string. I want to write it into Excel using the ClosedXML library. Dictionary> data = new Dictionary>(); List list1 = new…
Hello
  • 796
  • 8
  • 30
1
vote
1 answer

Excelfile to DataGridview with ClosedXML

In my project I have to import an Excelfile. The type is .xlsx. The file has a table in it with 4 columns. I have to add extra columns to this excel file. My problem is that with my solution the DataGridview has the headertext twice. And every time…
el_Sharpo
  • 67
  • 5
1
vote
0 answers

ClosedXML: C# Excel Import auto format Excel file

I am working with closedXML in C#. I'm importing an Excel. It is importing correct data but auto-format rows and headers every time. I need to compare data of Excel file in C# with a standard template. Due to formatting, it doesn't match. Can…
1
vote
2 answers

How to use fonts having space in C# windows form to create excel workseet?

I am using an IEnumerable variable to create an Excel worksheet in C# windows form application. The problem is that I can set created worksheet font if the font name has 1 word, ex. 'IRNazanin', but for font name with space it doesn't work, ex. 'B…
Ali Majed HA
  • 212
  • 1
  • 4
  • 16
1
vote
1 answer

In C#, how can I set the background color cell of exported Excel file to particular color based on some conditions?

I am using following reference to insert data into Excel. Based on the codes below, I want to set the cell color which will also contain some data (like Score) using ClosedXML.Excel.XLWorkbook; XLWorkbook workbook; workbook = new…
Vim
  • 161
  • 2
  • 3
  • 11
1
vote
2 answers

Storing XML values as a list using ClosedXML package

I'm using the C# CLosedXML package to acquire XML data values and place them into a list. From what I found online, the only example of storing the values into an array in a list is as shown below. var dataList = new List() { …
Nate
  • 119
  • 1
  • 2
  • 10
1
vote
1 answer

How to download an excel in a chrome browser having options as Open, Save and Cancel as i used closed Xml in C#?

How to download an excel in a chrome browser having options as Open, Save and Cancel as I used closed Xml in C#? public FileResult ExportToExcel(List StudentList) { List titles = new List { new string[]…
1
vote
0 answers

ClosedXML encoding using datatable and memorystream

I am exporting an excel using ClosedXML and a datatable and it's works well. My issue is that the encoding is messing with my language e.g.: "æ" shows as æ I've tried quite a few things like adding: Response.Charset =…
Ghost
  • 313
  • 1
  • 2
  • 14
1
vote
0 answers

Closed XML - Datatable and rows count

I am trying to use Closed XML in a C# ASP.NET Web application. I have a dataset which contains more than 30 data tables. I want to pass each of the data table as a separate worksheet and then create the excel. Each data table has 10000 rows and 255…
Venkat
  • 89
  • 12
1
vote
1 answer

How to remove part of string and save style format

I have a cell with a content. I want to remove part of this content but with persistence style format. I tried to use function Substring(), but it doesn't save style format For example: My cell: Want to see: var firstDot =…
Anthony14
  • 105
  • 6
1
vote
1 answer

Is it possible to use ClosedXML to read Excel file to Ax 2012?

I have used ClosedXML to create an excel file with 3 worksheets from AX 2012 R3. I'm wondering if it is possible to use ClosedXML to read the excel file back in to AX?
Dean Ball
  • 33
  • 6