none
Excel 2016 - Typelib disappears! RRS feed

  • Question

  • Hi,

    I'm coding in native C++/MFC with VS2010.  With Office 2013 the process involved generating wrapper classes from a Typelib :  VS2010 --> MFC Class Wizard --> Add Class --> MFC Class from TypeLib.  On the 'Add class from typlibwizard' dialog you could pick from all the typelibs in the registry and there was an Excel one.  On selecting it you would choose which interfaces you wanted and C++ wrapper classes would be generated.  Lovely!

    Since uninstalling Office 2013 and installing Office 2016 I have observed the strangest behaviour, which is:

    1. The Excel type library is not in the list of type libraries like it was before.  In VS2010 or the Ole/Com Object Viewer application.
    2. I run a repair install of Office 2016 and the Excel type library appears in VS2010 and  the Ole/Com Object Viewer application.
    3. I shut the computer down for the day and next day, they've disappeared again!  Repair-installing puts them back but they've gone after the next reboot.

    Is anyone else having a similar problem?  Any solution / workaround would be most appreciated!  Thanks!

    Pete


    Creator of the Software Update Wizard... add update over the web to your app with a single line of code!

    Wednesday, October 21, 2015 12:49 PM

Answers

All replies

  • Hi Peter,

    Did you install any computer restore software?

    >>I shut the computer down for the day and next day, they've disappeared again! <<

    Can you reproduce this issue after you reboot the computer immediately? If not, it seems that there are some application would affect the Office application. I would suggest that you install the Office 2016 on a clean environment to see whether the issue could be reproduced.

    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.

    Thursday, October 22, 2015 6:18 AM
    Moderator
  • Hi Fei,

    Many thanks for taking the trouble to respond.  I installed Office 2016 on a clean machine as you suggested but cannot reproduce the problem.

    I suspect I'm experiencing a hangover from a problem I had when I ran the upgrade from Win7 to Win10.  It ran without any reported errors but when I opened Office 2013 64 bit for the first time after the upgrade my activation status had been lost, I couldn't re-activate (using my key) or even uninstall without errors.  Eventually I ran the Fixit for Office uninstallation, twice, which appeared to work, reinstalled Office 2013 and successfully activated.  From the (countless hours) troubleshooting I did on this it appears the upgrade changed Windows permissions on numerous folders and registry branches / keys.  Office 2013 was not the only application that had this sort of experience.  So maybe there is a residual issue, though Office 2016 works perfectly in every other respect.

    I thought of a possible workaround, which is to generate an .idl file from the clean install using the Ole/Com Object Viewer and then compile the .tlb using midl.exe.  However, I get this error:

    G:\TEMP\Typelib>midl Excel16.idl
    Microsoft (R) 32b/64b MIDL Compiler Version 7.00.0555
    Copyright (c) Microsoft Corporation. All rights reserved.
    Processing .\Excel16.idl
    Excel16.idl
    Processing C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\oaidl.idl
    oaidl.idl
    Processing C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\objidl.idl
    objidl.idl
    Processing C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\unknwn.idl
    unknwn.idl
    Processing C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\wtypes.idl
    wtypes.idl
    Processing C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\basetsd.h
    basetsd.h
    Processing C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\guiddef.h
    guiddef.h
    .\Excel16.idl(765) : error MIDL2025 : syntax error : expecting a type specification near "single"
    .\Excel16.idl(765) : error MIDL2026 : cannot recover from earlier syntax errors; aborting compilation

    In case anyone fancies trying to generate the typelib file I've put a zip on my OneDrive : this is the download link.

    Thanks!

    Pete


    Creator of the Software Update Wizard... add update over the web to your app with a single line of code!

    Thursday, October 22, 2015 1:44 PM
  • Hi Pete,

    Thanks for the detail information for this issue.

    Since this issue could not be reproduced in a clean machine, I suggest that you reinstall the environment to fix this issue.

    And for the compile issue, it seems this is know issue. Please try replace the "single" with "float". More detail, you can refer to the thread below:
    https://social.msdn.microsoft.com/Forums/en-US/ac309f83-92a0-4282-bf6f-ff38a09c01b9/excel-ole-automation?forum=Vsexpressvc

    Hope it is helpful.

    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.


    Friday, October 23, 2015 3:00 AM
    Moderator
  • Hi Fei,

    Great links, thanks!  I'm not optimistic than reinstall will fix my problem as full repair didn't but it doesn't matter.  I didn't realise that compiling the idl file (which I couldn't) was not necessary if I did the following:

    1. Opened Excel.exe as a file in VS2010
    2. Exported the Typelib resource as a file (with a tlb extension).
    3. Thereafter used the file option in the MFC Typelib wizard.

    Thanks again for your help!

    All the best,

    Pete


    Creator of the Software Update Wizard... add update over the web to your app with a single line of code!

    Friday, October 23, 2015 8:25 AM