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

Slow load time

Jan 28, 2011 at 1:52 AM

I have the following code (in brief) that had been working fine until now.


using System;

using System.IO;

using System.Collections.Generic;

using System.Text;using System.Xml;using System.Net;

using System.Drawing;using System.Text.RegularExpressions;

using HtmlAgilityPack;

using OfficeOpenXml;

using OfficeOpenXml.Style;

using OfficeOpenXml.Style.XmlAccess;

namespace XTFReportGenerator


class Program


        static void Main(string[] args)        


         string root = "C:\\temp\";

string htmlVersion = "";


// create root directory

root = Path.Combine(root, version);

if (!Directory.Exists(root))   { ... } 


// create the root workbook

FileInfo xlsxFile = new FileInfo(root + "\\test.xlsx");            

if (xlsxFile.Exists)   { ... }


using (ExcelPackage package = new ExcelPackage(xlsxFile))  { ... }





The statement 

using (ExcelPackage package = new ExcelPackage(xlsxFile))  

is causing the program to take an awfully long time to load, has anyone experienced similar issue before?





Jan 30, 2011 at 6:20 PM


Creating the package should be a very fast operation. The sheet data is not loaded until you access the worksheets collection the first time.

I have no real good advice to you, but check that the file is'nt locked or that you aren't out of memory