title: Excel Worksheet SelectionChange event doesnt get fired firsr time but works second time
body: <p>I have a winform dialog in my excel add-in, which is popped up on click of a panel button. I have a selection change event added to worksheet. The event is not being fired first time. I have to close the dialog and the open it again, This time it will work. Am I missing something here, or it is bug with excel interop API? </p>
  
  <p>Enviornment:Excel 2007, .NET 4.0, Interop runtime: v1.1.4322</p>
  
  <p>Following is the code </p>
  
  <pre><code>public partial class CreateColumn : Form
  
      {
  
      public CreateColumn()
      {
          InitializeComponent();
          Excel.Worksheet ws = Globals.ThisAddIn.Application.ActiveSheet;
          //Bug: this event does not fire the first time.. works on second time.
          ws.SelectionChange += new   Excel.DocEvents_SelectionChangeEventHandler(ColRangeSelChange);
  
      }
  
      public void ColRangeSelChange(Excel.Range target) 
      {
          System.Windows.Forms.MessageBox.Show(target.AddressLocal);
      }}
  </code></pre>
  
  <p>This is how Create Column is being called</p>
  
  <pre><code> private void smartTemplateBtn_Click(object sender, EventArgs e)
   {
        Range SelectedRange = Globals.ThisAddIn.Application.Selection;
        if (SelectedRange != null)
        {
             List&lt;string&gt; DataSetLabels = new List&lt;string&gt;();
             foreach (Range cell in SelectedRange.Cells)
             {
                  if (cell.Value2 != null &amp;&amp; !cell.Value2.Equals(""))
                  {
                      if (!DataSetLabels.Contains(cell.Value2))
                      {
                          DataSetLabels.Add(cell.Value2);
                      }
                  }
             }
             if (DataSetLabels.Count &gt; 0)
             {
                 PopupCreateColumnDialog(DataSetLabels);
             }
        }
   }
  
   public void PopupCreateColumnDialog(List&lt;string&gt; DataSetLabels)
   {
        if (DataSetLabels.Count &gt; 0)
        {
             CreateColumn colDialog = new CreateColumn();
             colDialog.TopMost = true;
             colDialog.Show();
        }
   }
  </code></pre>