git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55899
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
- // 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;
{
wxLogWarning(wxT("Cannot start an instance of this class."));
return false;