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

Optimize memory usage when using ClosedXML to read XLSX File

I've got an XLSX sheet that contains about 30 columns and 130,000 rows. In the past I used OleDb data reader to parse such files but it was problematic in case of reading unknown excel files with mixed cell data types. I found ClosedXML but the…
Marcin
  • 35
  • 3
3
votes
1 answer

C# Blazor Export To Excel File Format or File Extension is not valid

I have a list that I am trying to export to excel using the following code with the ClosedXML nuget package and following a guide online: private async TaskClickExportXLS() { await ExportToExcel(js,…
Adil15
  • 405
  • 1
  • 5
  • 15
3
votes
1 answer

Saving Excel file of 50k rows using "ClosedXML" NuGet taking a very long time

I need to save data into an Excel file(.xlsx). I decided to use "ClosedXML" NuGet (v0.95.3) (https://www.nuget.org/packages/ClosedXML/) for implementing it, after getting several recommendations on this NuGet from different developers. Recently I…
Nuriel Zrubavely
  • 463
  • 3
  • 13
3
votes
4 answers

Add hyperlink to excel sheet closedxml

I am converting a data table to excel which is working fine. I have 4 columns in data table. Column1 and Column2 are simple text. Column3 and Column4 are hyperlink url and display text. all 4 columns are exported as it is in excel with below code : …
Always_a_learner
  • 1,254
  • 1
  • 8
  • 16
3
votes
1 answer

Show / Interactive / Visible ClosedXML Excel.XLWorkbook Without Saving

Using ClosedXML is it possible to show a new Excel.XLWorkbook() in the GUI without first saving the file? I am using VB .Net and moving from Microsoft.Office.Interop.Excel to ClosedXML to take advantage of the increased speed. In Excel Interop I can…
GoodJuJu
  • 1,296
  • 2
  • 16
  • 37
3
votes
1 answer

C# ClosedXML assign values from cells in a specific row to string

I'm using ClosedXML elsewhere in my script where I'm iterating through every row like this and it works. var workbook = new XLWorkbook(ObjectRepPath); var rows = workbook.Worksheet(1).RangeUsed().RowsUsed().Skip(1); foreach (var row in rows) { …
HeadlyvonNoggin
  • 313
  • 1
  • 3
  • 14
3
votes
1 answer

How to read cell value from excel file using ClosedXML

string TablePath = Storage.ProjectPath + "\\Tables\\"; string ObjectRepPath = TablePath + "ObjectRepository.xlsx"; string locType = " "; string locParm = " "; var workbook = new XLWorkbook(ObjectRepPath); …
HeadlyvonNoggin
  • 313
  • 1
  • 3
  • 14
3
votes
0 answers

ClosedXML export data set to excel with specific date format

I am exporting a DataSet to excel that was generated by running an SQL script within my C# program. The DataSet correctly stores certain columns as datetimes, but from my understanding it does not store formatting information. It appears then that…
3
votes
2 answers

Could not load file or assembly 'DocumentFormat.OpenXml - Again

It seems that this problem is a very popular one, and I've already read nearly a dozen of similar questions, but all offer the same solution (install and reference DocumentFormat.OpenXml 2.5), which I already did, and it's still not working. I am…
J R
  • 227
  • 3
  • 8
3
votes
1 answer

Excel *.xlsx Document no longer allowing us to do Calculations and Return Results

So i'm having an issue which is baffling me. Originally, we have an application which gets a varying set of Values (Based on user Input), which is then sent to an .xlsx spreadsheet (Set into certain cells) and then using these values, various…
Evendyce
  • 41
  • 3
3
votes
2 answers

Creating pivot table using ClosedXML

I'm trying to create a Pivot table using ClosedXML V0.91.1, but I keep getting problems with my excel file having unreadable content and then the excel workbook removing my pivot table when clicking Yes below. Below is that shows when I hit Yes.…
Jimenemex
  • 3,104
  • 3
  • 24
  • 56
3
votes
2 answers

How do I work with an open Workbook in Excel using ClosedXML (C#)?

I am using ClosedXML to make reports for people in Excel. There are 3 issues that I would like some help with. 1) I have this code here so I can access data from a workbook. It works correctly except for when someone has that workbook open. I…
djblois
  • 963
  • 1
  • 17
  • 52
3
votes
1 answer

Is it possible to Perform a find in Excel using ClosedXML?

Is it possible to do a find in ClosedXML? I looked through their documentation and there is no record of it. How else can I look at all the methods included in ClosedXML, so I can find some of these things on my own?
djblois
  • 963
  • 1
  • 17
  • 52
3
votes
1 answer

ClosedXml Cannot access a closed Stream

I am getting the "Cannot access a closed Stream" when I am trying to save a ClosedXML Workbook (XLWorkbook) to a memory stream. public byte[] GetStream() { using (var stream = new MemoryStream()) { …
Andrei Ivascu
  • 1,172
  • 8
  • 17
3
votes
1 answer

reading Excel with ClosedXML

What would be the most efficient way to read an entire Excel file using ClosedXML and returning List> ? This somehow doesn't give me data. I get empty lists. var wb = new XLWorkbook(finalFilePath); var ws =…
konrad
  • 3,544
  • 4
  • 36
  • 75