How do I install and use it ?

Dec 30, 2011 at 12:22 PM

My project is in ASP.NET and I am using VB script. I do not have visual studio installed.

Can you tell me where to find the instructions for installing ClosedXML in .NET ?


Dec 30, 2011 at 11:47 PM

You must be using classic ASP and not ASP.NET. In such case you can treat ClosedXML like you would treat any other .NET library.

Jan 2, 2012 at 4:17 PM

Message body

Dear MDeLeon,
I am using ASP.NET but coding directly without visual studio. I am using Framework 4
I tried copying the files to C:\Windows\Microsoft.NET\assembly\GAC_32\ClosedXML folder and specified
in my code.
 dim Workbook as xlworkbook = new XLWorkbook()
dim worksheet = workbook.Worksheets.Add("Sample Sheet")
worksheet.Cell("A1").Value = "Hello World!"
There was no error on the 'IMPORTS' line but the compiler error is :
Compiler Error Message: BC30002: Type 'xlworkbook' is not defined.

Source Error:

Line 314:	Protected Sub ClosedXML (ByVal sender As Object, _
Line 315:                          ByVal e As System.EventArgs)
Line 316:			dim Workbook as xlworkbook = new XLWorkbook()
Line 317:            dim worksheet = workbook.Worksheets.Add("Sample Sheet")
Line 318:            worksheet.Cell("A1").Value = "Hello World!"
Apparently the system simply ignores any IMPORTS it cannot locate.
I want to know for using ClosedXML, where do I copy the extracted files. Also is DocumentFormat...DLL required to be installed and if so how do I install it ?
Thanks for the help
Jan 2, 2012 at 4:33 PM

You don't need to "install" or register the DLLs. Just copy ClosedXML.dll and DocumentFormat.OpenXml.dll to your /bin folder and use:

Imports ClosedXML.Excel

You shouldn't have to do anything else but just in case ASP.NET is being stubborn you could also add it to the config file:

        <Add Assembly="ClosedXML" />
        <Add Assembly="DocumentFormat.OpenXml" />
Jan 3, 2012 at 5:52 PM

Dear MDeLeon

Thanks for the help. It worked great.