X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/87fe783d01a93eb067bbe54b72afcd75c07062a2..e2bfe6731edfca732418012b03438db85b4aa0dd:/src/msw/ole/automtn.cpp?ds=sidebyside diff --git a/src/msw/ole/automtn.cpp b/src/msw/ole/automtn.cpp index 3fb683fbcf..d10484a938 100644 --- a/src/msw/ole/automtn.cpp +++ b/src/msw/ole/automtn.cpp @@ -538,8 +538,13 @@ bool wxAutomationObject::CreateInstance(const wxString& classId) const return false; } - // start a new copy of Excel, grab the IDispatch interface - if (FAILED(CoCreateInstance(clsId, NULL, CLSCTX_LOCAL_SERVER, 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;