closedxml.dll not able to add to reference

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

Hi,

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 asp.net 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?

 

Thanks,

Ramesh

Coordinator
Jul 17, 2011 at 3:58 PM

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

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

Hi,

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.

Note:

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 0.56.3.0) 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.

 

Thanks,

Ramesh

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

Hi,

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