Excel 2013 and Exception from HRESULT: 0x800A01A8


  • Hello,

    I use a shared Excel Addin written in C#

    using Excel = Microsoft.Office.Interop.Excel;
    using Office = Microsoft.Office.Core;
    [GuidAttribute("12B22828-5CDD-4AED-B888-4AE8B84ED7B3"), ProgId("Jedox.Palo.XlAddin.Connect")]
    public class Connect : Extensibility.IDTExtensibility2, System.IDisposable
    	private static Office.CommandBar myBar;
    	Microsoft.Office.Core.CommandBarButton myButton
    	// other variables
            public void OnStartupComplete(ref Array custom)
    		// ...
                    Office.CommandBars oCommandBars = (Office.CommandBars)ExcelHelper.oExcelApp.GetType().InvokeMember(
    		myBar = oCommandBars.Add(
    			Name: Office.MsoControlType.msoControlPopup, 
    			Temporary: true);
    		myBar.Name = "myBar Name";
    	        myButton = (Microsoft.Office.Core.CommandBarButton)myBar.Controls.Add(
    				Type: Office.MsoControlType.msoControlButton, 
    				Temporary: true);
    		myButton.Caption = "myButton Caption";
                    myButton.OnAction = "!<Connect>";
                    myButton.FaceId = mItemPasteView.= 457;
    		// ...
            public void OnBeginShutdown(ref System.Array custom)
    		// ...
    		if (myBar.Position == Office.MsoBarPosition.msoBarBottom)
    		// ...;
    		// ...
    	// other methods

    After starting Excel 2013 with disabled start screen I open a stored Excel file which has just the formula =Upper2("aha") in Sheet1!A1.

    When I now close Excel I get

    System.Runtime.InteropServices.COMException (0x800A01A8): Exception from HRESULT: 0x800A01A8
       at Microsoft.Office.Core.CommandBar.get_Position()

    at the line

      if (olapBar.Position == Office.MsoBarPosition.msoBarBottom)

    in method  OnBeginShutdown

    I looks like the stored reference become invalid ( it is != null).

    This problem doesn't occur with Excel 2010 or older.

    The problem also does not occur with enabled 2013 start screen.

    What can I do ?


       Hendrik Schmieder

    Monday, March 04, 2013 1:49 PM

All replies

  • Hi Hendrik,

    Thank you for posting in the MSDN Forum.

    I'll consult your issue with my colleague. You'll be informed if there's any update.

    Thank you for your patience and understanding.

    Best regards,

    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, March 05, 2013 12:19 PM
  • Hello Hendrik,

    I tried to reproduce the issue using the code that you mentioned here. However, I am not getting the exception.

    Could you please share a sample project so that I can test and confirm if the issue occurs.


    Sreerenj G Nair

    Wednesday, March 13, 2013 10:32 PM