Jeppen

Jeppen

  • NA
  • 1
  • 15.6k

AppEvents_SheetChangeEventHandler only fires event once

Feb 4 2011 8:24 AM
Hello,

I am pretty new to Excel plugin writting.

I created a procedure which is executed when a cell in the worksheet is modified.

Unfortunatelly the code is only executed once. So the first the the user writes something in the excel sheet the code is executed, but then the procedure is not called anymore.
Am i missing something?
Here is my code:


private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
#region VSTO generated code

this.Application = (Excel.Application)Microsoft.Office.Tools.Excel.ExcelLocale1033Proxy.Wrap(typeof(Excel.Application), this.Application);

#endregion
this.Application.SheetChange += new Excel.AppEvents_SheetChangeEventHandler(ThisWorkbook_SheetChange);
}




void ThisWorkbook_SheetChange(object Sh, Excel.Range Target)
{
MessageBox.Show("Passed");
}

Thanks in advance,
Jeppen