C# VSTO for Excel在C中用于设置和使用工作表更改事件的示例?
我正在尝试为私有void ThisAddIn_Startupobject发送方System.EventArgs e方法中的工作表更改事件连接事件处理程序 如果我接受使用tab键添加的条目,则会将以下行添加到private void ThisAddIn_Startupobject sender System.EventArgs e: 并增加了以下方法:C# VSTO for Excel在C中用于设置和使用工作表更改事件的示例?,c#,excel,vsto,C#,Excel,Vsto,我正在尝试为私有void ThisAddIn_Startupobject发送方System.EventArgs e方法中的工作表更改事件连接事件处理程序 如果我接受使用tab键添加的条目,则会将以下行添加到private void ThisAddIn_Startupobject sender System.EventArgs e: 并增加了以下方法: private void ActiveWorksheet_Change(Excel.Range Target) { }
private void ActiveWorksheet_Change(Excel.Range Target)
{
}
这将编译,但在以下位置引发异常:
activeWorksheet.Change += ActiveWorksheet_Change;
是否有关于使用VSTO和C将事件与Excel外接程序一起使用的示例参考
最近有没有关于使用VSTO和C的书籍?请使用以下代码:
this.Application.SheetChange += Application_SheetChange;
private void Application_SheetChange(object Sh, Excel.Range Target)
{
// your code here
}
this.Application.SheetChange += Application_SheetChange;
private void Application_SheetChange(object Sh, Excel.Range Target)
{
// your code here
}