return false;
}
- // start a new copy of Excel, grab the IDispatch interface
- if (FAILED(CoCreateInstance(clsId, NULL, CLSCTX_ALL, IID_IDispatch, (void**)&m_dispatchPtr)))
+ // get the server IDispatch interface
+ //
+ // NB: using CLSCTX_INPROC_HANDLER results in failure when getting
+ // Automation interface for Microsoft Office applications so don't use
+ // CLSCTX_ALL which includes it
+ if (FAILED(CoCreateInstance(clsId, NULL, CLSCTX_SERVER, IID_IDispatch,
+ (void**)&m_dispatchPtr)))
{
wxLogWarning(wxT("Cannot start an instance of this class."));
return false;