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
0
votes
1 answer

Operator '>=' is not defined for type 'Integer' and 'closedxml.excel.ixlrow

I tried to add pagebreak every 13 row with ClosedXML but i got stuck to solve this Dim xrow As Integer = 0 Do Until xrow >= ws.LastRowUsed() ws.PageSetup.AddHorizontalPageBreak(xrow) xrow += 13 Loop am getting the error as Operator '>='…
Touchy Vivace
  • 304
  • 2
  • 16
0
votes
1 answer

Setting the FillColor of MS Excel Cell using NumberFormat

I need to set the Fill Color (Background) of the Excel Cell to Red or Green based on some threshold value. I have used Style.Fill.BackgroundColor and Style.Font.FontColor property conditionally to fill the background color and font color but then…
Nikhil Girraj
  • 1,135
  • 1
  • 15
  • 33
0
votes
1 answer

How to specify default path for saveAs dialog box for export excel from .net

HttpContext.Current.Response.Clear(); HttpContext.Current.Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; HttpContext.Current.Response.AddHeader("content-disposition",…
0
votes
0 answers

How to convert xls file to xlsm in c#

I am working with ClosedXML utility for excel operations. It only supports files created on office versions 2007 on-words. I have an xls file and required to convert to xlms(macro enabled). Simple copy as shown below is not working. string oldFile =…
Razack
  • 950
  • 3
  • 13
  • 26
0
votes
1 answer

ClosedXML reading text color from cell rich text

I'm importing an XLSX file into a database using ClosedXML via an ASP.NET/VB.NET. My customer needs to keep formatting of single cells, so the solution is to use the cell's RichText property. I wrote a piece of code that should tranform RichText…
0
votes
1 answer

Determine if an IXLCell is using a DateTime format

All, In .NET, I'm using ClosedXML to read in an uploaded Excel file and converting the cells to a 2D array of strings. The end goal is to modify certain cells and display the modified cells to the user. I'm currently having trouble handling cells…
bclarke
  • 15
  • 1
  • 5
0
votes
3 answers

Generating spreadsheet from tables using OpenXML

Goal: Generate a spreadsheet with worksheets named off of tables and column names listed on the first row of each worksheet. These will actually be based off classes build from those tables. Issue: After opening the spreadsheet it claims it found…
Tony
  • 3,269
  • 1
  • 27
  • 48
0
votes
1 answer

Copy worksheets lost header and footer

My web application use ClosedXML to work with Excel files. I'm trying to copy worksheet using an Excel template with header and footer, but in the result they don't appear. Only the data and cells appear. I use this method to copy my…
oteal
  • 614
  • 2
  • 13
  • 25
-1
votes
1 answer

Exporting DataGridView data to Excel file in C# Windows Form

Excel file save to local drive in C# Windows form I have a grid view with data. I want to download or save it to my local drive in excel format. excel file with row data or without row only header text name when click on button.
arbabu
  • 17
  • 4
-1
votes
1 answer

'Parameter count mismatch' Error when trying to insert List to Excel using closedXml InsertData

I am trying to export dynamic list items to excel using ClosedXML. The goal is to allow end user to select the columns to be exported. Since the columns are dynamic, I use.ToDynamicListAsync() of System.Linq.Dynamic.Core name space. The problem is…
Rubeesh
  • 97
  • 1
  • 4
-1
votes
1 answer

ClosedXML. Is there a way I can gothrough every row in a Column with C#

I want to go through every column in my Excel file and save each cell in a var, So I can print it out in the Console (For testing purposes). I know how I can do it with one Cell but not with every Column and row. Could someone help me with this. I…
sDevPaul
  • 9
  • 3
-1
votes
1 answer

How to create a list of DataTables from a DataTable based on Key?

I have an Excel data which looks like below. Using ClosedXML, I've read the data into DataTable. Now again I need to store records into separate DataTable based on CID value. i.e., Records which are having same CID value should be stored into…
Tech Learner
  • 1,227
  • 6
  • 24
  • 59
-1
votes
1 answer

How to convert JsonResult to ClosedXml?

I have a dataset in a JSON-format. But how can I write this to a ClosedXML-format? dataSet.Data { total = "123456", data = Count = 11, model '{\fields":{"DocumentId":{"title""... private void SetWorkbook(IXLWorkbook workbook, JsonResult…
user1531040
  • 2,143
  • 6
  • 28
  • 48
-1
votes
2 answers

I'm trying to pass DataTable to Class and I get this message: Input string was not in a correct format

I am taking an excel file to read the fields and pass it to a class, to be able to enter the DB, when I pass dt.AsEnumerable, it is giving me an error in the "Linea" field. This cell sometimes comes with the $ sign. I think that is what is…
-1
votes
1 answer

ClosedXML - Method of returning workbook via API in latest version no longer functions

returning a workbook via an httpresponse in a get call, the method used for an older version of ClosedXML, now returns an empty workbook - workbook tabs are created and correctly named, but are empty. Sample code - trimmed down for basic response …
VBartilucci
  • 477
  • 6
  • 17
1 2 3
40
41