locked
Embedding Excel (Excel 2010 vs Excel 2013) RRS feed

  • Question

  • Hi,

    We currently have a piece of automation code that works perfectly with Excel 2007 and Excel 2010, but we haven't managed to make it work with Excel 2013.

    What we are trying to achieve is embedding an Excel workbook within another window.

    Here are the incriminated lines of code:

    IOleObject *pole
    Excel::_Application *app=NULL;
    Excel::Workbooks *wbList=NULL;
    Excel::_Workbook *wb = NULL;
    IUnknown *excelApp=NULL;
    
    CoCreateInstance(clsidExcel, 0, CLSCTX_LOCAL_SERVER, IID_IDispatch, reinterpret_cast<void **>(&excelApp));
    excelApp->QueryInterface(__uuidof(Excel::_Application),(LPVOID *)&app); 
    wbList->raw_Open(bstrFilename, vNoParam,vNoParam,vNoParam,vNoParam,vReadOnly,vNoParam,vNoParam,vNoParam,vNoParam,vNoParam,vNoParam,vNoParam,0,&wb);
    wb->QueryInterface(IID_IOleObject, (void**)&pole);
    
    pole->SetClientSite((IOleClientSite*)&m_xOleClientSite);
    
    hr = m_xOleDocumentSite.ActivateMe(NULL);
    if (FAILED(hr))
    {
        pole->DoVerb(OLEIVERB_INPLACEACTIVATE, NULL, (IOleClientSite*)&m_xOleClientSite, (UINT)-1, m_hwnd, &rcView);
    }

    None of the last two lines is working with Excel 2013...

    We also tried to call these methods on a Workbook opened in Excel via the Windows Explorer, without any custom automation, but it doesn't work either.

    Does anyone have an idea of what we could try?

    Thanks



    • Edited by Eric Bourry Tuesday, October 15, 2013 5:00 PM
    Tuesday, October 15, 2013 3:46 PM

Answers

  • Hi,

    Office as a whole is moving away from embedding. I would recommend moving away from embedding office applications.

    For more in-depth support, please visit the below link to see the various paid support options that are available to better meet your needs.  http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone.

    Regards

    Pradip

    Monday, November 4, 2013 9:19 AM
    Answerer

All replies

  • Hi,

    Thank you for posting in the MSDN Forum.

    I'm trying to involve some senior engineers into this issue and it will take some

    time. Your patience will be greatly appreciated.

    Sorry for any inconvenience and have a nice day!

    Best regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Edited by Marvin_Guo Wednesday, October 16, 2013 7:21 AM
    Wednesday, October 16, 2013 7:21 AM
  • Hi,

    Office as a whole is moving away from embedding. I would recommend moving away from embedding office applications.

    For more in-depth support, please visit the below link to see the various paid support options that are available to better meet your needs.  http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone.

    Regards

    Pradip

    Monday, November 4, 2013 9:19 AM
    Answerer