none
Excel custom task pane not working with another addin's RRS feed

  • Question

  • I'm developing a custom task pane in an excel Visual Studio add-in. It is working fine in excel 2010 but in excel 2013, for some unexpected reason, it doesn't show anything when another addin is enabled. No errors or exceptions are thrown.
    There's no apparently difference between versions on debug mode, the program is executed normally, except the line "ActpPainel.Visible = true; " that doesn't work.
    My problem is very similar with this question:
    http://stackoverflow.com/questions/24577747/excel-custom-task-pane-not-showing

    Is it a microsoft excel 2013 bug? There's a way to solve it(without removing the others addin)?
    Thank you, guys.
    Wednesday, October 7, 2015 1:45 PM

Answers

  • Hi Marcelo,

    I made a test with your code with Solver Add-in under excel 2013, but I failed to reproduce your issue.
    Here is code for my test:

    //Ribbon1.cs file        
    private void ShowTaskPane_Click(object sender, RibbonControlEventArgs e)
            {
                OnBtnSourceAssociation(e.Control);
            }
            public void OnBtnSourceAssociation(IRibbonControl control)
            {
                Globals.ThisAddIn.OpenPanelSourceAssociation();
            }
    //ThisAddIn file
            private MyUserControl myUserControl1;
            private Microsoft.Office.Tools.CustomTaskPane myCustomTaskPane;
            private void ThisAddIn_Startup(object sender, System.EventArgs e)
            {
                myUserControl1 = new MyUserControl();
                myCustomTaskPane = this.CustomTaskPanes.Add(myUserControl1, "My Task Pane");
                myCustomTaskPane.Visible = false;
            }
    
            private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
            {
            }
            public void OpenPanelSourceAssociation()
            {
                myCustomTaskPane.Width = 275;
                OpenPanel(myCustomTaskPane);
            }
            private void OpenPanel(Microsoft.Office.Tools.CustomTaskPane ActpPanel)
            {
                ActpPanel.Visible = true;
            }
    

    I suggest you create a simple project with this function to check whether this issue still exist. If it does, I suggest you repair your Excel and upgrade your Excel to latest version to check again.

    Best Regards,

    Edward


    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.


    • Marked as answer by MarceloGhost Wednesday, October 14, 2015 12:38 PM
    Friday, October 9, 2015 8:41 AM

All replies

  • Hi MarceloGhost,

    >> Excel custom task pane not working with another addin's

    What another add-in is, is it your own add-in or excel system add-in?

    I made a test with excel custom task pane in excel 2013, it shown up correctly. Where did you use “ActpPainel.Visible = true”? Did you call it in ThisAddIn_Startup or any other button click event? It would be helpful if you could share us steps to reproduce your issue.

    If this code in ThisAddIn_Startup, and task pane did not show up, I suggest you click developer-> Com add-ins-> uncheck the add-in->click ok->com add-ins->check the add-in to check whether it could show up.

    Best Regards,

    Edward


    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 8, 2015 2:36 AM
  • Hi, Edward, thanks for reply

    My addin crashes with anyone of these:
    - Analysis ToolPak
    - Euro Currency Tools
    - Solver Add-in

    But this occurs only in excel 2013, I already tried in excel 2010.

    I use "“ActpPainel.Visible = true” in a button event.

    When the user press the button is called this function:

    public void OnBtnSourceAssociation(Office.IRibbonControl control){

    Globals.ThisAddIn.OpenPanelSourceAssociation();

    }

    After:

    public void OpenPanelSourceAssociation(){

    ctpGenerateReport.Width = 275;

            OpenPanel(ctpSourceAssociation);

    }

    The ctpSourceAssociation is created in ThisAddIn_Startup:

    ctpSourceAssociation = this.CustomTaskPanes.Add(
                new SourceAssociationCtrl(Globals.ThisAddIn.Application), "Associar uma Fonte");

    and finally:

    private void OpenPanel(Tools.CustomTaskPane ActpPanel){

    ActpPanel.Visible = true;

    ...

    }

    Do you think the problem could be the use of global variables? For me doesn't make sense it works only in older versions of Excel.

    Best regards,

    Marcelo

    Thursday, October 8, 2015 11:59 AM
  • Hi Marcelo,

    I made a test with your code with Solver Add-in under excel 2013, but I failed to reproduce your issue.
    Here is code for my test:

    //Ribbon1.cs file        
    private void ShowTaskPane_Click(object sender, RibbonControlEventArgs e)
            {
                OnBtnSourceAssociation(e.Control);
            }
            public void OnBtnSourceAssociation(IRibbonControl control)
            {
                Globals.ThisAddIn.OpenPanelSourceAssociation();
            }
    //ThisAddIn file
            private MyUserControl myUserControl1;
            private Microsoft.Office.Tools.CustomTaskPane myCustomTaskPane;
            private void ThisAddIn_Startup(object sender, System.EventArgs e)
            {
                myUserControl1 = new MyUserControl();
                myCustomTaskPane = this.CustomTaskPanes.Add(myUserControl1, "My Task Pane");
                myCustomTaskPane.Visible = false;
            }
    
            private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
            {
            }
            public void OpenPanelSourceAssociation()
            {
                myCustomTaskPane.Width = 275;
                OpenPanel(myCustomTaskPane);
            }
            private void OpenPanel(Microsoft.Office.Tools.CustomTaskPane ActpPanel)
            {
                ActpPanel.Visible = true;
            }
    

    I suggest you create a simple project with this function to check whether this issue still exist. If it does, I suggest you repair your Excel and upgrade your Excel to latest version to check again.

    Best Regards,

    Edward


    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.


    • Marked as answer by MarceloGhost Wednesday, October 14, 2015 12:38 PM
    Friday, October 9, 2015 8:41 AM
  • Hi, Edward

    Thank you again for reply.

    In fact, following your code everything works smoothly. But I was initializing the CustomTaskPane at start up of excel (sorry, I was mistaken, actually wasn't me who wrote this code...) anyway, if the inicialization function is called when the user press the button, the program works. But when the variables are initialized before, nothing shows up. Remember this only happens on excel 2013 with another addins enabled.

    Another strange fact: If I open excel, disable the addin and enable it again, it works too.

    So, to solve this issue I put the inicialization function when the button is pressed.

    Thank you!
    Best Regards
    Wednesday, October 14, 2015 12:37 PM