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

How do you open a ClosedXML Workbook from a stream?

I have an ASP.NET MVC app where a user can upload an xlsx file to be processed. This creates a HttpPostedFileBase object in the upload that has a handy stream method, HttpPostedFileBase.InputStream. I want to process the file using ClosedXML, but I…
Jess
  • 23,901
  • 21
  • 124
  • 145
4
votes
3 answers

ClosedXML New Workbook Styles All Sheets

I just got started with ClosedXML. When I create a new workbook with the code below, it automatically applies "Blue, Table Style Light 9" to each worksheet. I don't want any style on the worksheets. How do I specify no style? XLWorkbook wb = new…
J. Wilson
  • 101
  • 1
  • 7
4
votes
3 answers

Run Microsoft Excel application from MemoryStream

Does someone knows, is it possible to open Microsoft Excel from unsaved file? From memory stream for example? var workbook = new XLWorkbook(); var worksheet = workbook.Worksheets.Add("Sample Sheet"); worksheet.Cell("A1").Value = "Hello…
4
votes
4 answers

ClosedXML SecurityException: Requested registry access is not allowed

I am using ClosedXML to export an Excel file and I can't seem to export the Excel file. Every time I click on the Button to Export the Excel File(XLSX) I get an error. See Below... using (XLWorkbook wb = new XLWorkbook()) { …
Arraylist
  • 307
  • 3
  • 13
4
votes
2 answers

ClosedXML Excel filter rows by values in multiple columns

I have a Excel file with several thousand rows and columns up to "BP". I need to filter all of these rows by specific values in columns C and BP. I tested the filter functionality in ClosedXML as per the code below. When I apply a filter to one…
4
votes
2 answers

Excel don't recognize formulas from closedXML / c#

Info: The following code is in a foreach loop Works: indexSheet.Cell("G" + cellIndex).FormulaA1 = "=SUM(A1:A10)"; Only works, when i type this directly in excel: indexSheet.Cell("G" + cellIndex).FormulaA1 = "=FIND(\"erw\";H5)"; // with…
volta
  • 53
  • 2
  • 9
4
votes
2 answers

Changing sheet displayed with ClosedXML

I am dynamically creating an Excel workbook with multiple sheets using ClosedXML. I am struggling changing the sheet selected back to the first sheet in the workbook after I am done generating the content and cannot find anything in the…
AndrewK
  • 1,223
  • 2
  • 16
  • 25
4
votes
3 answers

ClosedXML: Export To Excel not downloading the File MVC 4

I have a List, which I convert to a Datatable and then export that Datatable to Excel via Kingsoft-Spreadsheets using ClosedXML library. However, for some reason the code is not working and the sheet is not getting downloaded. I am getting…
user3289773
  • 77
  • 1
  • 2
  • 11
4
votes
2 answers

Remove all formatting of the table created from InsertTable method in ClosedXML

I'm using ClosedXML to generate a report. The data supplied to Excel is from a database which is stored to a DataTable object. The table is displayed fine in the Excel sheet - however, it has a default theme applied on the created table. Below is…
saiha
  • 93
  • 1
  • 7
4
votes
0 answers

export to excel throwing System.outofmemoryexception when more than 70k rows (Closed XML)

I am using closedxml to export datatable to excel in asp.net. it works fine if i export less than 50k rows but throwing exception when i export more rows. It has 31 columns. I am Spliting the datatable to 10000 rows then adding the datatable to a…
user3067170
  • 193
  • 4
  • 14
4
votes
4 answers

ClosedXML read row with VLOOKUP formula

im currently working on a project that reads data from excel using closedXML but im having errors with my code because the excel cells have vlookup formulas in it. is there a way for closedxml to read row values with vlookup formulas? Thanks! this…
Page F.P.T
  • 653
  • 4
  • 11
  • 24
4
votes
1 answer

"The specified package is invalid. The main part is missing." In Closed XML

I am using the closed XML for generating the excel template. After filling the data in the generated excel, I am trying to import the excel with data. It returns error "The specified package is invalid. The main part is missing." . I am using XLSX…
Razack
  • 950
  • 3
  • 13
  • 26
4
votes
4 answers

Does ClosedXML support setting a worksheet's zoom level?

I am using closedXML to generate an Excel file from C# and I am trying to see if there is anyway to set the zoom level of a worksheet. I can't find this in any of the documentation or from googling? Does anybody know how to do this?
leora
  • 188,729
  • 360
  • 878
  • 1,366
4
votes
1 answer

Chart doesn't update when adding new rows to an existing Excel table (not without having to use named ranges)

I'm really new to the use of closedXMl and Excel too(at least for this purpose) so sorry if I'm asking silly questions. I know that closedXML doesn't support charts yet so the only thing that came to mind to get around this was to create my chart …
eddy
  • 4,373
  • 16
  • 60
  • 94
3
votes
3 answers

OpenXML linq query

I'm using OpenXML to open a spreadsheet and loop through the rows of a spreadsheet. I have a linq query that returns all cells within a row. The linq query was ripped straight from a demo on the MSDN. IEnumerable textValues = from cell…
Jagd
  • 7,169
  • 22
  • 74
  • 107