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

How install the ClosedXML NuGet

I'm trying to install ClosedXML NuGet in an ASP / VB.NET project that uses .NET Framework 4.0, and I'm getting the following error: What do I need to do for ClosedXML be installed OK in my project? Thanks in advance, Marcelo Camarate
2
votes
1 answer

Set table style. C# - closed xml

I am looking for a way to apply a table style to the inserted data in an excel file. I use the library closed xml How can I do it? Sample table I want to get using (XLWorkbook wb = new XLWorkbook(excel)) { IXLWorksheet ws =…
RobinВricks
  • 93
  • 1
  • 1
  • 10
2
votes
2 answers

How to center Image inside a merged cell range in ClosedXML

I am using ClosedXML (https://github.com/ClosedXML/ClosedXML) for creating an excel file in my C# MVC Controller. As per the documentation in https://github.com/closedxml/closedxml/wiki/How-can-I-insert-an-image, I have inserted an image in a cell…
Jithin Shaji
  • 23
  • 1
  • 3
2
votes
1 answer

How to read from excel cell display value without evaluating formula with ClosedXML

I have an excel file and I want to import its data to a web application using ClosedXML. Now I am using this to read a date as string: var validFrom = ((DateTime)row.Cell("B").Value).ToString("d/M/yyyy"); and this to read a decimal as string: var…
mike_x_
  • 1,900
  • 3
  • 35
  • 69
2
votes
2 answers

How can I generate an Excel file with a 90 degree letter rotated down header in C#?

I am working on a Human Resources app, that needs to show a working environment excel report, like it's demonstrated in this image. Now I am looking for help with this topic, I am using ClosedXML.Excel, currently I am generating my Excel files with…
2
votes
1 answer

c# API Export Excel (ClosedXML) and Download in Angular 6

I made a post from Angular to an C# Api with success passaing and mount an Excel with (ClosedXML). I can format and save in a folder my finished Excel File as I wish. But I need to return this Excel to Angular as binary or similar as download event…
Adriano Frota
  • 488
  • 3
  • 14
  • 27
2
votes
3 answers

Is there a way to differentiate between SQL Money and Decimal types in .NET?

Money and Decimal SQL types both get interpreted as Decimal in .NET. Is there any way to tell the difference? I am trying to format an Excel spreadsheet correctly, but do not know which fields should be formatted for currency and which should be…
Dryden Long
  • 10,072
  • 2
  • 35
  • 47
2
votes
2 answers

ClosedXML Insert data from List into existing proper Excel Table (named range) c#

There was a similar question, it didn't seem answered (maybe there's not an answer). How do you "update" an existing Excel Table (named range) from Closed XML. I know how to get the table info, and delete the existing data (see below) var ws =…
White-N-Nerdy
  • 21
  • 1
  • 4
2
votes
1 answer

How to mix Excel Interop with ClosedXml: styles

I am trying to achieve the following in an Excel VSTO add-in: Copying/applying cell formatting from the original version of an Excel file. Reason: while processing Excel files, we occasionally need to change the style/coloring of a file in order to…
LocEngineer
  • 2,847
  • 1
  • 16
  • 28
2
votes
0 answers

Format an excell column as link (ClosedXML generated file)

i generated an excel file with ClosedXML library XLWorkbook wb = new XLWorkbook(); wb.Worksheets.Add(dt,"aaaaa"); wb.SaveAs("aaaa.xlsx"); one column of the datatable contains a link (a string with a valid url), the generated excel file doesn't show…
pinale
  • 2,060
  • 6
  • 38
  • 72
2
votes
0 answers

Asp.net mvc 5 with closedxml. not able to export to excel. getting virus detection message

I am trying to export data to excel using closedxml api but getting virus detected error on export My code is below [HttpGet] public ActionResult ExportToExcelNew() { string sheetName = "Report"; var…
Kamran Shahid
  • 3,954
  • 5
  • 48
  • 93
2
votes
3 answers

Downloading excel file from web api using closedxml

I can't get it to work to download an excel file that was created by closedxml through web API. If I save the file on the server it looks good, but as soon as I put it in a stream and return it to the web api, then only a corrupt file is recieved…
2
votes
0 answers

Using same template for multiple excel sheets

I am working on ASP.NET application where there is a functionality for exporting realizations in .xls format. Every realization can have more projects, so each project should have separate sheet in excel. I have excel template that should be used…
m.mrksic
  • 29
  • 1
2
votes
2 answers

ClosedXML predefined style

Is it possible to create and store predefined style in ClosedXML, so I can apply it to a certain range later?Just like Excel can. For example by a static class: public static class ReportStyle { public static XLStyle Default { get { …
Khaine
  • 295
  • 5
  • 18
2
votes
1 answer

ClosedXml Range Error

I am using ClosedXml and I am getting the following error when trying create a range of headers from a range table. The cells A13 and P13 are outside the range ''SalesOrderHeaderId_1'!A7:P8'. Here is the C# Code I am using to try and create the…
OutOFTouch
  • 1,017
  • 3
  • 13
  • 30