none
Excel 2016 Automation: the trouble with references RRS feed

  • Question

  • Hi,

    I just upgraded to the 64-bit version of Excel 2016 and am now having problems with automation through Visual Studio Professional 2015.  I'm on Windows 10.  The first problem was not being able to find the reference Microsoft.Office.Interop.Excel so I tried to find Office 2016 PIAs to download.  I couldn't find any so I added a reference to Microsoft Office 16.0 Object Library, but then when I tried to run my code, it gave the following error:

    COMException was unhandled:

    An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll

    Additional information: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)).

    This didn't happen until I upgraded from 32-bit Excel 2016 to 64-bit Excel 2016.  Any ideas what might be happening?  Is there a solution for this?  Are there special references I need?  I even tried to repair Visual Studio and this didn't help either. 

    Thanks in advance,

    acard2008

    Monday, November 30, 2015 9:50 PM

Answers

  • Hi,

    Based on the error message, this issue should relative to the Excel application instead of Visual Studio. I suggest that you repair the Excel application to see whether it is helpful.

    If not, I suggest that you uninstall the Excel application and reinstall the 64-bit Excel to see whether the issue was resolved.

    Regards & Fei


    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.

    Tuesday, December 1, 2015 2:22 AM
    Moderator

All replies

  • Hi,

    Based on the error message, this issue should relative to the Excel application instead of Visual Studio. I suggest that you repair the Excel application to see whether it is helpful.

    If not, I suggest that you uninstall the Excel application and reinstall the 64-bit Excel to see whether the issue was resolved.

    Regards & Fei


    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.

    Tuesday, December 1, 2015 2:22 AM
    Moderator
  • Looks like windows registry records for Excel are messed up after upgrading Excel. You need to repair/reinstall Excel to refresh windows registry keys.
    Tuesday, December 1, 2015 9:53 AM
  • Thanks Fei,

    I ended up uninstalling the 64-bit version and re-installing the 32-bit version and this seems to have fixed the problem.  I might retry with the 64-bit version later but I'm a little doubtful because a co-worker who has the 64-bit version on a different machine had the same problem.  So, maybe when I have some downtime, I'll retry.

    acard2008

    Tuesday, December 1, 2015 6:14 PM
  • Hi,

    Thanks for the insight.  As my reply to Fei says, uninstalling the 64-bit version and re-installing the 32-bit version did the trick for now.  I may try with 64-bit again later when I have more time.  But it's good to know the why so thank you.

    acard2008

    Tuesday, December 1, 2015 6:17 PM