none
Excel CoCreateInstance failed with 0X80040154 RRS feed

  • Question

  • In the morning my code worked, in the afternoon it suddenly didn't:

    Excel CoCreateInstance failed with 0X80040154

        CLSID clsid;
        HRESULT hr = CLSIDFromProgID(L"Excel.Application", &clsid);
        if(SUCCEEDED(hr)) {
            hr = CoCreateInstance(clsid, nullptr, CLSCTX_LOCAL_SERVER, IID_IDispatch, (void **)&m_pExcelApp);
            if(FAILED(hr)){
                m_pExcelApp = nullptr ;
                gLogger.LogCOMError(ekImmediateErrorMsg, hr, "Excel CoCreateInstance failed");
                return E_FAIL ;
            } 
        } 
    

    Maybe there's been an update which changed some registry values or something? Registry corrupted?

    I've tried..

    DISM.exe /Online /Cleanup-image /Restorehealth

    ...but that did not change anything.

    What else can I try?

    TIA

    Owen


    http://www.ransen.com Cad and Graphics software

    Friday, August 9, 2019 6:02 AM

All replies

  • I don't want to should success, but in the end it looks like I just had to reinstall Office 2016.

    Currently working, but who knows tomorrow...


    http://www.ransen.com Cad and Graphics software

    Friday, August 9, 2019 7:40 AM