This project has moved and is read-only. For the latest updates, please go here.

closedxml.dll not able to add to reference

Jul 17, 2011 at 4:24 PM
Edited Jul 17, 2011 at 4:29 PM


Your product looks very exciting & very promising to me and I'm very much eager to use it.

I downloaded these 3 items.

1. closedxml.dll

2. closedxml.xml

3. DocumentFormat.OpenXml.dll

Also I added these 3 to the bin directory of my c# project.

I added the reference to 'DocumentFormat.OpenXml.dll' successfully.

But when i added a reference to closedxml.dll, it got added but showed the yellow warning icon before the reference.

Also the code 'var workbook = new XLWorkbook();' showed the red underline for XLWorkbook() saying "You are missing an assembly reference...".


********** My Codebehind ***********

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

using DocumentFormat.OpenXml;

namespace SampleXls{   

public partial class demoexcel : System.Web.UI.Page    {       

protected void Page_Load(object sender, EventArgs e)        {            CreateExcel();        }
        private void CreateExcel()        {                       

var workbook = new XLWorkbook();           

var worksheet = workbook.Worksheets.Add("Sample Sheet");           

worksheet.Cell("A1").Value = "Hello World!";           

workbook.SaveAs("HelloWorld.xlsx");        }    }}



Could you please help me, what I should do now to successfully execute it?




Jul 17, 2011 at 4:58 PM

Change "using DocumentFormat.OpenXml;" with "using ClosedXML.Excel;"

Jul 17, 2011 at 6:35 PM
Edited Jul 17, 2011 at 6:39 PM


I tried using ClosedXML.Excel;

But now it shows the ClosedXML underlined.

It is because (as I said in my earlier post), when i added the reference to ClosedXML.dll, it shows a yellow warning besides the added dll file.


1. I kept both ClosedXML.dll and ClosedXML.xml files in \bin directory. I added the reference of ClosedXML.dll from here only.

2. I'm using ClosedXML.dll (version and my web project (c# web app) is in .Net Framework 3.5. I downloaded the appropriate dll only.


Please let me know, how i can rectify this issue.




Jul 17, 2011 at 7:21 PM
Edited Jul 17, 2011 at 7:22 PM


It's Fixed.

I deleted the reference, closed my application, re-downloaded the closedxml and added the reference.

Now it works like charm.


Thanks! It got fixed.

- Ramesh