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
3
votes
2 answers

Read or retrieve value from spreadsheet using existing rangenames

I have an existing excel file and it has already defined cell name or cell range names. I am able to get all cell range names using Openxml sdk. My sample code is given below: var path = @"D:\test.xlsx"; using (var document =…
Ravi Anand
  • 5,106
  • 9
  • 47
  • 77
3
votes
2 answers

Set readonly column in closedxml column

I got stuck for setting "ReadOnly" column using "ClosedXML" utility for export to Excel. I am able to export records into Excel, however the first "ID" column I need to keep it read only, user should not type anything. If he want to add new row in…
Rocky Royalson
  • 119
  • 2
  • 6
3
votes
2 answers

How to assign a list to a Cell(Dropdown format) in closedXML while Exporting to Excel

I am just trying to Export a Datatable (Datatable doesn't have any data - having only header). In addition, i have a List which i want to append to the column, such that, after export to excel that column (all cells except header) should…
Chandan Kumar
  • 4,570
  • 4
  • 42
  • 62
3
votes
1 answer

Can I Set an Image to *Not* Auto-Resize?

I have a "template" Excel file with a few basic things set for a layout (some merged cells, some column widths, etc.), which is then used by ClosedXML to populate with data. At a basic level it's as simple as: var workbook = new…
David
  • 208,112
  • 36
  • 198
  • 279
3
votes
0 answers

C# OpenXML ClosedXML Read / Set Chart axis Min Max

I have an Excel spreadsheet with a "Line with Markers" chart. The chart is sourced from data in a separate datasheet within the same workbook. If I open the workbook using ClosedXML SDK, and then change the datasheet only, it changes the data…
JLeRogue
  • 53
  • 1
  • 6
3
votes
1 answer

How to get the full value from an excel cell, not the displayed (rounded) value?

I'm having an issue retrieving the exact value from an cell from a worksheet. If I open the file the cell has a decimal number which it's shown only with 4 decimals, but if I click on the particular cell, the value is different, having 6 decimals. I…
BogdanM
  • 957
  • 4
  • 15
  • 32
3
votes
1 answer

ClosedXML read from excel file

I have an excel file. I simply need a cell value. I am having a hard time finding documentation on this. I have done ClosedXML before where I write date to an excel file but not where I read from it. const string fileName = …
Nate Pet
  • 44,246
  • 124
  • 269
  • 414
3
votes
3 answers

How to append a new row to an Excel file using C# and ClosedXML?

I should append a new row to an existing Excel file. The task consists of two parts: Add to non-existing file (works well). Add to existing file (doesn't work: it doesn't make NEW record, displaying only the old record from "else" body). Here is…
Vlad Rudskoy
  • 677
  • 3
  • 7
  • 24
3
votes
1 answer

Need to use ClosedXml and Save excel file to local pc

i use closedxml in asp.net project to generate file excel, and now i want to save my excel file to my local pc but it now work. [i already tried from my local browser and it saved to my server folder]. i really need your guide. thanks. and here is…
Deddy H
  • 252
  • 2
  • 6
  • 19
3
votes
3 answers

Why close xml does not support .xls formated excel file?

During accessing ".xls" formated excel file using "closed xml" dll following exception is occurred Exception : Excel may contain corrupted data...
Shriram Sapate
  • 155
  • 3
  • 6
  • 15
3
votes
2 answers

ClosedXml doesn't copy spreadsheet's printer settings

I have xltx Excel's template, when I create (manually) new document from it and click File->Print in Excel first sheet fits on one page. Than I create new document from my template with the help of ClosedXml: using System; using…
Evgeny Timoshenko
  • 3,119
  • 5
  • 33
  • 53
3
votes
1 answer

ClosedXML Case-sensitiv columns headers

As example I have such code: DataTable table = new DataTable("Name"); table.Columns.Add("CASESENSITIVE", typeof(string)); table.Columns.Add("casesensitive", typeof(string)); table.Rows.Add("Indocin", "David"); table.Rows.Add("Enebrel", "Sam"); var…
Igor Tabas
  • 31
  • 3
2
votes
0 answers

Could not load file or assembly 'SixLabors.Fonts' ClosedXML NugetPackage

When in production I am trying to export database table into excel using ClosedXML nuget package however I get this error in the title, I tried it locally on localhost but it works perfectly fine. I have checked the dll files in production and the…
Am Ma
  • 21
  • 1
2
votes
0 answers

ClosedXML writing decimal numbers with comma instead of point

I have been using ClosedXML to write and create sheets in an excel file. I am running into an issue, on systems that have non-US locales. Instead of writing three hundred point four-one as 300.41 ClosedXML is writing this decimal number as…
2
votes
0 answers

Day and Month Wrongly Switched in Excel Result Using ClosedXML

I'm trying to export excel using ClosedXML and I have problem in fixing datetime format. My desired cell format is "dd.MM.yyyy HH:mm:ss" but when the day of the month is 12 or less, it automatically switches the day and the month and results in…
Iraj
  • 319
  • 3
  • 17