none
ActiveX wrappers issue with Excel 2010 RRS feed

  • Question

  • Hi,

    I am facing an issue with ActiveX wrappers which are used in Excel 2010 to display different UI components.

    I am rendering number of controls in Excel workbook using VSTO addin. When I save the workbook, controls get deleted but the corresponding ActiveX wrappers get stored in the workbook. When I reopen the workbook and try to insert the controls again, it throws exception "Cannot insert object". 


    Attachment contains a VSTO solution with workbook in which issue is reproducible. Following are the steps to reproduce the issue:
    1. Extract and open the solution. Shared at http://1drv.ms/MraOEO
    2. Run the solution. This will open the excel.
    3. Open the attached file. Shared at http://1drv.ms/1eGVoCq (Extract and open it)

    4. Click on "Insert Control" button. This will show an error.

    This issue doesnt appear on every Save operation. It is coming randomly on saving and inserting control.

    This issue is not reproducible with Excel 2007. Also, if I save the corrupted file on Excel 2007, it works fine on Excel 2010 as well. Seems like Excel 2010 makes some changes in the file which causes this issue.

          Please let me know if anyone has faced this issue or any idea about the issue.

    Thanks & Regards,

    Diptesh Raut.


    Diptesh Raut.

    Monday, February 17, 2014 6:31 AM

All replies

  • Hi,

    Following are the Excel version details I am using:

    MS Excel 2010 (14.0.7109.5000) SP1 MSO (14.0.7113.5005)

    I have tried the same on Excel 2013 as well, it worked fine there as well. Please let me know if there is any fix available for this issue.

    Thanks & Regards,

    Diptesh Raut.


    Diptesh Raut.

    Monday, February 17, 2014 6:43 AM
  • Hi Diptesh,

    I'm moving your question to VSTO forum where you could get better responses.

    Thanks for your understanding.


    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, February 18, 2014 6:20 AM
    Moderator
  • Hi Raut,

    As far as I know, there is no support for adding new ActiveX controls to your documents from within Visual Studio Tools for Office since Visual Studio 2008.

    If you create a Visual Studio Tools for Office project using an existing Word document or Excel workbook that contains ActiveX controls, the functionality of the ActiveX controls is not lost; however, there is no support for adding new ActiveX controls to your documents from within Visual Studio Tools for Office. For example, if your Word document has a button from the Control toolbox that runs a Visual Basic for Applications (VBA) macro, it will continue to run the macro after the document has been used in a Visual Studio Tools for Office project. However, it is recommended that you remove ActiveX controls and VBA macros and replace them with Windows Forms controls and managed code.(refer to Limitations of Windows Forms Controls on Office Documents)

    Hope this is helpful.

    Best 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.

    Wednesday, February 19, 2014 2:19 AM
    Moderator
  • Hi Fei Xue,

    Thanks for your reply. 

    I think there is some confusion. I am not adding ActiveX wrappers, rather I am adding the winform controls from VSTO (you can see in the shared sample example). 

    As per my knowledge, Excel internally uses ActiveX wrapper to display Winform control(same is mentioned in the link given by you). And these wrappers get stored in the workbook after saving the workbook. 

    If you refer to my shared sample where I want to embed label control from VSTO, it throws exception. Also, same workbook is working with Excel 2007 & 2013.

    Please inform if there is any solution/workaround for this issue.

    Thanks & Regards,

    Diptesh Raut.

    Wednesday, February 19, 2014 7:35 AM
  • Hi Diptesh Raut

    On how many machines have you tested this? Is it reproducible on numerous machines? Or is it possible that there's another add-in perhaps interfering on the 2010 machine?

    Why are controls getting deleted when you SAVE the workbook? Normally, the controls will be removed when a workbook is closed.


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, February 19, 2014 2:20 PM
    Moderator
  • Hi,

    I have tested this on at least 5 machines having Excel 2010. There were no other addins present on those machines.

    Yes, on Save + Close operation controls were getting removed.

    Thanks & Regards,


    Diptesh Raut.

    Wednesday, February 19, 2014 2:37 PM
  • Thanks for the information about installations.

    About removing the controls: You haven't told us WHY they're being removed on save?


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, February 19, 2014 4:01 PM
    Moderator
  • Hi Cindy,

    Controls do not get removed on Save. Rather they are removed on workbook close operation. In earlier post it was a typo from my side.


    Diptesh Raut.

    Thursday, February 20, 2014 5:03 AM
  • Hi,

    Is anyone looking into this issue?

    Thanks & Regards,


    Diptesh Raut.

    Monday, February 24, 2014 11:09 AM
  • Hi Raut,

    Since the issue is complex, 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

    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.

    Wednesday, February 26, 2014 5:14 AM
    Moderator
  • Hello Diptesh,

    I am looking into this. I will keep you posted on the updates.

    Thanks!!

    Monday, March 10, 2014 9:23 PM
  • Hello Diptesh,

    I am able to reproduce this issue following your repro steps in Excel 2010 (32Bit). However, for some reason the issue does not show up with Excel 2010 (64Bit).

    This issue requires in depth investigation and hence falls into the paid support category.

    If you would like to continue further, please open a paid support ticket with us. If the support engineer determines that the issue is the result of a bug the service request will be a no-charge case and you won't be charged. 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

    Thanks!!


    Monday, April 7, 2014 6:06 PM