In our application, powerpoint object is instantiated using the below code. This works fine under normal circumstances but when run *under stress* that is the object is created, the presentation exported and then the object is released continuously, the
CreateInstance calls fails with -2147023179 sometimes. Even after a failure, the next attempt succeeds. Also at a time the stress keeps running from 3 user account in Windows Terminal Server 2008 R2 server.
PowerPoint::_ApplicationPtr spPpApp;
HRESULT hr = spPpApp.CreateInstance(__uuidof(PowerPoint::Application));
if (FAILED(hr))
{
return 1;
}