Sridhar,
Thanks for this info, it provided some good insight on a different approach. I changed the instantiation of the ExcelEngine to use a singleton pattern and it seems to have cleared up the error.
Here is a sample snippet on the solution:
private static ExcelEngine _excelEngine;
…
///
/// Singleton instance of ExcelEngine
/// protected static ExcelEngine ExcelEngine
{
get
{
if (_excelEngine == null)
_excelEngine = new ExcelEngine();
return _excelEngine;
}
}
…
Changed to use the singleton property of ExcelEngine when creating an instance of IApplication:
///
/// outputs the results of the query to the stream as an excel spreadsheet
/// ///
///
public Byte[] SaveSRExportAsExcel(SearchCriteria criteria)
{
IApplication application = ExcelEngine.Excel;
IWorkbook workbook = application.Workbooks.Create(1);
Seems to clear up the problem. I will update you if we still see any issues with this approach.