none
Excel crashing when accessing ActiveChart in CommandBars OnUpdate handler in Excel 2016 (64 bit) RRS feed

  • Question

  • We are developing an addin and are having some issues with Excel 2016 (64 bit). The following describes our situation:
    1. Our addin is installed and active.
    2. We open a blank new Workbook, write some numbers and insert an Excel chart.
    3. We close the Excel window and choose not to save it (it does not matter if the chart is selected when closing the Workbook).

    Excel closes and it displays a message that it crashed. This is repeatable every single time:

    Faulting application name: EXCEL.EXE, version: 16.0.6001.1034, time stamp: 0x561f40a3
    Faulting module name: ucrtbase.DLL, version: 10.0.10240.16384, time stamp: 0x559f3851
    Exception code: 0x40000015
    Fault offset: 0x0000000000065a5f
    Faulting process id: 0x450
    Faulting application start time: 0x01d11b8cf0fd7651
    Faulting application path: C:\Program Files\Microsoft Office\Root\Office16\EXCEL.EXE
    Faulting module path: C:\Program Files\Microsoft Office\Root\Office16\ucrtbase.DLL
    Report Id: 431089f1-8780-11e5-90cb-001c42be5d20

    If we disable our addin this does not happen. If there are no Excel charts in the workbook it also does not happen.

    We also tracked down the issue and found out that the problem seems to be accessing Application.ActiveChart property in the CommandBars.OnUpdate event handler. If we do not access that property it also does not crash.

    1. Is there any know issue that describes a similar scenario?
    2. What could cause this Exception? I have tried searching the web and there are many different solutions for this Exception but they either do not apply to our case or they did not work.
    3. It is funny to note that this only happens with the "old" Excel charts. This issue does not happen if we insert for example Waterfall chart that was added in 2016. It seems that the logic for the old and the new charts is different. Maybe the old charts were ported to the new architecture and some issue was introduced? Or something along those lines.
    4. Maybe you can offer guidelines for debugging this issue? What is the ucrtbase.DLL, what could cause it to crash?

    Thanks.


    Tuesday, November 24, 2015 2:34 PM

All replies

  • Hi,

    >>Application.ActiveChart property in the CommandBars.OnUpdate event handler. If we do not access that property it also does not crash.<<

    Based on the description, you were customizing the Office UI.

    The use of CommandBars in some Microsoft Office applications has been superseded by the new ribbon component of the Microsoft Office Fluent user interface. For more information, search Help for the keyword "ribbon."

    I suggest that you using the Microsoft Office Fluent user interface instead of CommandBar developing to see whether the issue was fixed.

    Here are some helpful links about Office ribbon customization for you reference:
    Ribbon Overview

    Ribbon XML

    Walkthrough: Creating a Custom Tab by Using Ribbon XML

    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, November 25, 2015 5:23 AM
    Moderator
  • We are using the Ribbon and do not add any CommandBars objects with our addin. We do use the CommandBars.OnUpdate event. It triggers normally in all the Excel versions that we support. Did something change only in 64 bit version of Excel 2016? I'm asking that since we are not seeing any problems in any other versions (the event itself also triggers just fine in 64 bit version of Excel 2016). Also what is the connection between the old charts and the newly added ones with regards to this? Why would only some charts cause problems in this case?

    Wednesday, November 25, 2015 7:30 AM
  • Hi Mitja,

    Thanks for the detail information for this issue.

    I am trying to reproduce this issue with VSTO Excel add-in, however failed. Here is the test code for your reference:

      private void ThisAddIn_Startup(object sender, System.EventArgs e)
            {
                Globals.ThisAddIn.Application.CommandBars.OnUpdate += CommandBars_OnUpdate;
            }
       
     private void CommandBars_OnUpdate()
            {
                string sSource;
                string sLog;
                string sEvent;
    
                sSource = "Excel Add-in";
                sLog = "Application";
                sEvent = "CommandBars_OnUpdate Event";
    
                if (!EventLog.SourceExists(sSource))
                    EventLog.CreateEventSource(sSource, sLog);
                EventLog.WriteEntry(sSource, sEvent);
                EventLog.WriteEntry(sSource, sEvent, EventLogEntryType.Information, 1);
    
                 }

    And here is the test figure for your reference:
    http://1drv.ms/1OsZXW6

    Can you reproduce this issue with code above? If not, I suggest that you comment the line piece by piece to narrow down which line of code cause this issue.

    If yes, I suggest that you try to repair or re-install the Excel 2016 to see whether the issue was fixed.

    If you still have the issue, would you mind share a code sample to help us reproduce this issue?

    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, November 26, 2015 7:20 AM
    Moderator