For testing purposes, I tried to open the same workbook up to 1000 times in a row.
After exactly 100 loops, the code starts to bump into a cryptic CellsException on every execution.
int main()
{
intrusive_ptr<IWorkbook> wb;
// open workbook
StringPtr dirPath = new String("C:\\Temp\\");
try
{
for (int i = 1; i <= 1000; i++)
{
wb = Factory::CreateIWorkbook(dirPath->StringAppend(new String("input.xlsx")));
std::cout << "Create (" << i << ")" << std::endl;
}
}
catch (CellsException exc)
{
std::cout << "CellsException" << std::endl;
}
catch (Exception exc)
{
std::cout << "Exception" << std::endl;
}
return 0;
}
I have tried with XLSX and XLSM files.