I have created a function that returns a datatable
from a workbook
.
public async Task<DataTable> GetDataTableFromTabRowColumn(string sheetName, int startRow, int endRow, int startCol, int endCol)
{
var task = new Task(() =>
{
DataTable dt = new DataTable();
Workbook wb = new Workbook(FilePath); // error line
Worksheet worksheet = wb.Worksheets[sheetName];
dt = worksheet.Cells.ExportDataTable(startRow - 1, startCol - 1, (endRow - startRow + 1), (endCol - startCol + 1), options);
});
task.Start();
await task;
return dt;
}
It was running fine. When I made the function async, it's showing error:
Aspose.Cells.CellsException: 'You are using an evaluation copy and have opened files exceeding limitation.'
I am using licensed Aspose. Please help