Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
5 views

Closed XML - skip hidden cells?

I have a number of cells that are conditionally hidden (values visible in formula box but not displayed on sheet)depending on how the sheet is filled out. I want to skip parsing those values ...
VBartilucci's user avatar
0 votes
1 answer
17 views

ClosedXML debugging System.OutOfRangeException (maximum allowed length of the value is 255 characters) when loading an XlWorkbook

I'm getting a the below error when trying to load an xlworkbook: System.ArgumentOutOfRangeException: 'The maximum allowed length of the value is 255 characters. (Parameter 'value')' The code is ...
Rock1432's user avatar
  • 199
0 votes
1 answer
41 views

ClosedXML empty string instead of null value while bulk copy C#

I'm bulk copying DataTable into excel file with ClosedXML. In DataTable not all items have values. When puting it in file it seems that the value in this cells are "" (empty strings) instead ...
Piotr Grociak's user avatar
1 vote
0 answers
38 views

How can I extract image placed inside a cell in excel with C#?

I am currently trying to extract all images and their positions from an Excel file in C#. It works fine if the image is placed over the cells. In that case, I can use ClosedXML.Excel and retrieve them ...
MilleB's user avatar
  • 1,570
0 votes
1 answer
48 views

Why do I get the error "Cannot access a disposed object" when using a stream

I am trying to read an xlsx file using CloseXlm so I created the below ReadFile method. In order to test it, I've created a test method using MSTest and another method that creates an xlsx file and ...
Luciano Umpierrez's user avatar
0 votes
1 answer
24 views

How to create and download an Excel workbook with "Enable Editing" using ClosedXml in a Blazor WASM app

A Google search yielded: To create a spreadsheet with "Enable Editing" using ClosedXML in C#, simply create a new workbook and add data to it without applying any protection mechanisms; by ...
Cincy Steve's user avatar
0 votes
0 answers
72 views

Saving Date / DateTime type values in Data Tables

i had been trying to insert data from an excel file into a Db Data table . i had so much trouble with specifically inserting the Date or Datetime values into the database table columns . I posted this ...
Rodwan Alburie's user avatar
0 votes
1 answer
71 views

Comparing values of ClosedXML cells

I have been working on a program in VB.NET using ClosedXML. It basically should take in data from 2 Excel files. Here is a sample of 1st (and only) worksheet from the first file (referred to as ws2): ...
Rodwan Alburie's user avatar
-1 votes
1 answer
76 views

Closed XML - Excel - VB,Net

I'm pretty new to the field, I have been trying to use ClosedXML to create and modify Excel files automatically. But this doesn't seem to be working. I'm basically trying to copy data from 2 files ...
Rodwan Alburie's user avatar
0 votes
0 answers
50 views

ClosedXML and System.Memory Error in .NET 8: Anyone Solved This?

I’m migrating a project from .NET 4.8 to .NET 8. The ClosedXML library is compatible with .NET 8, but I’m encountering an error when using the XLWorkbook class. Despite installing System.Memory, the ...
Artillis Henrique's user avatar
0 votes
0 answers
39 views

How to increase row height if created Excel file contains images

Excel file with pictures is created in ASP.NET MVC controller using code from ClosedXML add image and from How to get typed data from sql select statement to Excel: public async Task<IActionResult&...
Andrus's user avatar
  • 27.7k
0 votes
0 answers
23 views

ClosedXML - Using the Unique formula

I am using the unique formula with ClosedXML All the formulas seem to work fine. When I use the follow ws.Cell(2,1).FormulaA1 = "=UNIQUE(MyDefinedData)"; In excel, it appears as =@UNIQUE(...
H20rider's user avatar
  • 2,252
0 votes
1 answer
32 views

Write protect columns but allow Auto-Filter in Excel created with ClosedXML

I am using ClosedXML with C# to create a Excel Worksheet. The requirement is to Allow Auto-Filer on all columns Allow edit only form column "B", write protect the remaining columns Allow ...
Pro West's user avatar
  • 399
0 votes
1 answer
54 views

How to get typed data from sql select statement to Excel

ASP.NET Core 8 MVC application controller should create an Excel spreadsheet with typed data in columns (numbers, strings, dates, logical) from arbitrary SQL select. I tried this code: public async ...
Andrus's user avatar
  • 27.7k
0 votes
0 answers
135 views

ParsingException thrown when deleting rows from IXLTable

I was previously using version 0.101.0, and I'm currently testing version 0.104.1 The code works on version 0.101.0. It basically deletes extra rows on the table: var lastRow = wbTable.DataRange....
Ton Manda's user avatar
0 votes
0 answers
106 views

Export files to Excel XLSX file using C# and ClosedXML.Excel

I have a problem with exporting my data to Excel XLSX format using C# ASP.Net and ClosedXML.Excel In practice when I execute the stored procedure "sProc_20241009" on the MySQL DB I have this ...
Hamamelis's user avatar
  • 2,105
0 votes
0 answers
41 views

[Solved]Use ClosedXML to modify Crystal Report export stream - cannot SaveAs - get an exception

I use ClosedXML(0.102.3) to modify Crystal Report export Stream, when I use this code ReportDocument crReportDocument = new ReportDocument(); crReportDocument.Load("D:\\Sample\\test.rpt"); ...
darkwindstom's user avatar
0 votes
0 answers
50 views

Export data as excel - last column shows unknown identifier 'item'

I am using Datatable.js and ClosedXML to export grid data to excel. This is the template snapshot, column name changed for privacy - And when I download the excel sheet, I get error in the last ...
shubhkr1's user avatar
0 votes
0 answers
42 views

Issues Exporting Data to Excel with ClosedXML and template XLSX

I have the following XLSX template: Column1Lbl Column2Lbl ... Column30Lbl Column31Lbl Column32Lbl Column33Lbl {{item.Column1}} {{item.Column2}} ... {{item.Column30}} {{item.Column31}} {{item....
Mathias's user avatar
0 votes
0 answers
26 views

ClosedXML apply already existing conditional formatting to inserted data

I'm looking to a way to apply already existing conditional formatting to data which are being inserted with InserData() method. If I apply the same style to new range it doesn't apply the conditional ...
piotr's user avatar
  • 71
0 votes
0 answers
75 views

Export to excel with dynamic columns & values in .net C#

I have a dynamic grid in kendo the column names and column number changes will be different based on conditions.I am not able to export since it is a dynamic list I have provided the code below ....
akshaya parimaladevi's user avatar
0 votes
0 answers
47 views

VB.NET Overwriting Excel Worksheets

I’m using VB.NET and ClosedXML to open two Workbooks (Workbook1 and Workbook2). I then delete Sheet1 from Workbook1 and copy Sheet1 from Workbook2 into Workbook1. My code does this part fine however ...
Patrick's user avatar
  • 232
0 votes
0 answers
147 views

ClosedXML Gives 'File Corrupt' Error after written by NPOI extension, But File is Not Corrupt C#

I am using the ClosedXML package (version 0.95.4) to open an Excel file (.xlsx), which was written via NPOI extension and upload to blob storage in Azure. So, the file have access. However, when I ...
Shivani's user avatar
  • 216
0 votes
1 answer
158 views

When opening an xlsx file with ClosedXML in C#, I get an ArgumentOutOfRangeException

I'm using the latest version of ClosedXML from NuGet: .102.3. I can open some spreadsheets with ClosedXML, but there are many which I cannot. New information: I went to the ClosedXML site and got the ...
Joe Moore's user avatar
0 votes
2 answers
115 views

FileContentResult return - 2 different controller methods, different result

I am using ASP.NET Core and ClosedXML to generate an Excel export. Export Method 1 Here is the controller method that DOES return an .xlsx file to the browser. The method gets called from a .cshtml ...
Ryan's user avatar
  • 672
0 votes
1 answer
90 views

ClosedXML (Ver 0.102.2): Setting horizontal alignment not working

I am trying to set horizontal alignment of cells when exporting data to excel. Cells with numbers should align right. What I did: First creating the table: var table = CurrentWorksheet.Range(1, 1, ...
rockie667's user avatar
0 votes
0 answers
40 views

Read data from the table, find the necessary user variable, and display it on the screen. ClosedXML

I'm still quite new to programming and I started with C#. I want to make a simple application that accepts an error number from the user, for example: "F_220". Read data from the table, find ...
What is L's user avatar
0 votes
2 answers
62 views

Why is this code with ClosedXML not working: BC32023 Expression is of type 'IXLRow', which is not a collection type

I have tried my own brain and severail AI tools but somehow this code with ClosedXML generates an error: BC32023 Expression is of type 'IXLRow', which is not a collection type. For Each cell As ...
joska paszli's user avatar
0 votes
0 answers
128 views

Issue with Adding Comments to Excel Cells using ClosedXML 0.102.2

I'm trying to add comments to specific cells in an Excel file using the ClosedXML library (version 0.102.2) in my C# project. However, when I open the generated Excel file, I encounter the following ...
Tidra's user avatar
  • 95
0 votes
0 answers
23 views

Add blank option to dropdown cell in closedxml

I am creating a dropdown in closedxml using c# by doing the following: List<string> supplyOptions = new List<string> { " ", "TRUE", "FALSE" }; ...
lross33's user avatar
  • 183
0 votes
0 answers
23 views

ClosedXML add at (@) symbol at formulas [duplicate]

I have to edit an excel file with C#, I am using ClosedXML library. I have the following formula in my C# code. string fxRateFormula = $"=IFERROR(INDEX('Control Tab'!$E$2:$E$157,MATCH($B5&&...
javierhersan's user avatar
0 votes
0 answers
67 views

reading excel file not working on web-server using ClosedXML

I have an application where I open an excel file and populate a listbox with the headers. I am using ClosedXML and have the ClosedXML NetGet Package installed and just tried the ClosedXML.Signed ...
James W's user avatar
  • 11
0 votes
1 answer
307 views

How to download an Excel file from ClosedXML in ASP.NET

I'm working on an ASP.NET webforms app, and I want to generate Excel files using ClosedXML from data that I retrieve from a database. So far, I've tried the example which should save the file to the C:...
George1917's user avatar
1 vote
2 answers
223 views

Convert var to int with ClosedXml in C#

I want to convert my var in a cell to an int, I know it is an int because I know that this column in my .xlsx file is full of int, but Convert.ToInt32() makes an error; I did: var km = feuille.Cell(&...
Roumilhac Clément's user avatar
0 votes
1 answer
43 views

Change Background-Color of portion of Text with Closedxml in Excel

Is there a way to change the background-color of a part of the text inside a cell? im aware of the richttext functions to change text-stylings but could no find anything for the background-color. I ...
jakob Ruedisser's user avatar
0 votes
2 answers
262 views

How to do AutoFill in Excel with OpenXml or ClosedXml?

In our organisation, people use an Excel spreadsheet with tabular data and a few formulas, which I need to connect to a data provider in C#. With OpenXML, or even better, ClosedXml, we can create or ...
Roland's user avatar
  • 5,126
1 vote
1 answer
97 views

Adding a predefined cell style in ClosedXml

Excel comes with a number of predefined cell styles such as Good, Note and Heading 3, as shown in the Cell Styles popup below. Is there a way to assign these cell styles to a range of cells in ...
Jonathan Wood's user avatar
0 votes
1 answer
80 views

ClosedXML insertData(List<Double>, True) results in only the first row as a Number while rest of the rows as general

I am using ClosedXML to handle exporting data from an addin to an excel file. I first get my data as List and convert it to List: List<double> columnData_lst = curr_data_woHdrs_lst[colIndex]...
Fawzi Masri's user avatar
0 votes
0 answers
26 views

Using ClosedXml giving not appropriate response

I am using the ClosedXML library for generating Excel sheets. I am Installing the latest version of the ClosedXML. I created an XL Workbook and add a single sheet to it. after executing the API not ...
user23509624's user avatar
0 votes
0 answers
45 views

Is it not possible to import Excel exported from FPSpread using ClosedXML

DefaultSkins.Classic.Apply(_currentTable.ActiveSheet); SaveFileDialog saveFileDialog = new SaveFileDialog(); saveFileDialog.Filter = "Excel Files (*.xlsx)|*.xlsx"; saveFileDialog.FileName = ...
Leonard's user avatar
  • 23
0 votes
0 answers
53 views

Possible to pass worksheet to ClosedXml opened in OpenXml

I want to use ClosedXml for all my excel reports. However, one of them is an xlsm with some charts in it that doesn't open in ClosedXml. Is there a way for me to open just a couple of sheets from the ...
Noel's user avatar
  • 83
0 votes
1 answer
135 views

ClosedXML - Data Inserted Doesn't Match Data Extracted

Getting away from OLEDB, I decided to try ClosedXML. Very simple to code, but most of the the data coming from the datatable isn't being written to the sheet correctly, and as when using OleDB, I'm ...
MartinS's user avatar
  • 145
0 votes
0 answers
96 views

C# - Excel - DisplayFormat - Get formatting details

I'm trying to get Excel cell formatting as users sees it. In VBA or the Microsoft.Office.Interop.Excel this is done via the DisplayFormat API. But I can't use interop or VBA on the prod server.. Is ...
St3ve's user avatar
  • 135
0 votes
0 answers
26 views

Unable to add blank header in excel with XLWorkBook

I am trying to add a blank row and then a datatable with headers in an excel sheet. Problem is if I try to add blank row it comes as a blank entry in second row but header is still there. Expected ...
Shalini Raj's user avatar
-1 votes
1 answer
253 views

Solved: c# closedxml excel saveas on a network drive throws error The process cannot access the file '...' because it is being used by another process

we wrote a tool to open an excel-file, fill it with datas from a database and save it with another name with closedxml.excel in c#. Sometimes it throws this error: The process cannot access the file '...
Sorrenia's user avatar
0 votes
0 answers
83 views

Speeding up formatting of excel sheet using ClosedXML

For the creation and formatting of my excel sheet I have these methods for formatting the worksheet: private void StylesRatesWorksheet(IXLWorksheet ratesWorksheet, List<object> ...
lross33's user avatar
  • 183
0 votes
1 answer
80 views

ClosedXML number formatting not working in version 0.102.2

I recently updated to .NET 8.0 from .NET core 3.1 and updated ClosedXML to verison 0.102.2 but the number formatting stopped working any idea what I am doing wrong? Formatting doesn't apply the first ...
Aniket Tiwari's user avatar
0 votes
0 answers
29 views

updating column after creation to have dropdown of options

I have this method here: using (XLWorkbook workbook = new XLWorkbook()) { // Export Rates worksheet ExportToWorksheet(workbook, "Rates", rateItems, ...
lross33's user avatar
  • 183
0 votes
1 answer
299 views

ASP .NET Cannot access a disposed stream

I'm trying to generate an excel file and then pass it to http response: [HttpPost("downloadCodesFile")] public async Task<IActionResult> DownloadExcelFile(...
Nina Marszałek's user avatar
0 votes
1 answer
224 views

ClosedXML problem with templates including chart

I'm working with Excel files via the ClosedXml library and have run into an issue I can't quite resolve. Normally there are no issues opening Excel files and adding data to them, formatting them etc. ...
Aidal's user avatar
  • 849

1
2 3 4 5
13