title: My Excel 2010 Add in only shows up when opening a blank workbook. Won't show up when opening existing document
body: <p>We have made an excel add in that is installed correctly and will only show up when opening Excel from the main icon (or a blank workbook).  It will NOT show up on the toolbar when opening any existing saved excel document.</p>
  
  <p>I have made sure that when opening an existing document, under file -> options -> add in, it is correctly checked in the COM add ins.  For us to use our add in, we have to open up a blank workbook, and drag our existing file to the blank workbook.</p>
  
  <p>Would anyone have any idea why it would only show up in the ribbon on a blank workbook and not on existing .xlsx files?</p>
  
  <p>I have even ran a test where I open a blank workbook, confirm the add in is on the ribbon,  put some text in a cell, save it to my desktop, close it, and then reopen it.  It then does NOT show up.  This add in was made with VS2010.</p>
  
  <p>Here is the code from "ThisAddIn.cs"</p>
  
  <pre><code>public partial class ThisAddIn
  {
      private void ThisAddIn_Startup(object sender, System.EventArgs e)
      {
      }
  
      private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
      {
      }
  
      #region VSTO generated code
  
      /// &lt;summary&gt;
      /// Required method for Designer support - do not modify
      /// the contents of this method with the code editor.
      /// &lt;/summary&gt;
      private void InternalStartup()
      {
          this.Startup += new System.EventHandler(ThisAddIn_Startup);
          this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
      }
  
      #endregion
  }
  </code></pre>
  
  <p>Here is the code from the Ribbon.cs file that we made...all it is doing is populating a few fields and setting up:</p>
  
  <pre><code>private void MyRibbon_Load(object sender, RibbonUIEventArgs e)
  {
  
    Excel._Workbook activeWorkbook = (Excel._Workbook)Globals.ThisAddIn.Application.ActiveWorkbook;
    if (activeWorkbook.Path == "")
    {
      string pathMyDocuments = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments);
      this.editBox1.Text = pathMyDocuments;
    }
    else
    {
      this.editBox1.Text = activeWorkbook.Path;
      this.fileBox.Text = "Converted_" + activeWorkbook.Name;
    }
  
    this.folderBrowserDialog1.RootFolder = System.Environment.SpecialFolder.MyComputer;
    this.folderBrowserDialog1.ShowNewFolderButton = true;
  
    //populate the dropdown box with spreadsheet templates
    using (SqlConnection conn = new SqlConnection("&lt;removed for stack overflow&gt;"))
    {
      using (SqlCommand command = new SqlCommand("&lt;sql command text removed for SO", conn))
      {
        command.CommandType = CommandType.Text;
  
        conn.Open();
        SqlDataReader reader = command.ExecuteReader();
  
        while (reader.Read())
        {
          RibbonDropDownItem item = Globals.Factory.GetRibbonFactory().CreateRibbonDropDownItem();
          item.Label = reader["MasterSpreadsheetName"].ToString();
          ddlSpreadsheetTemplate.Items.Add(item);
        }
      }
    }
  }
  </code></pre>