Code:
using System;
using System.Collections.Generic;
using System.Text;
using Excel = Microsoft.Office.Interop.Excel;
using System.Windows.Forms;
namespace ConsoleApplicationProva1
{
class Program
{
static void Main(string[] args)
{
Excel.Application thisApplication = new Excel.Application();
thisApplication.Visible = true;
thisApplication.StatusBar = "Enor";
thisApplication.Workbooks.Add(System.Type.Missing);
//
thisApplication.SheetActivate += new Excel.AppEvents_SheetActivateEventHandler(thisApplication_SheetActivate);
}
void thisApplication_SheetActivate(object sender, Excel.Range target, ref bool cancel)
{
MessageBox.Show("Enor");
}
}
}
This code wich I found in e book fires error like below
Error 1 No overload for 'thisApplication_SheetActivate' matches delegate 'Microsoft.Office.Interop.Excel.AppEvents_SheetAct ivateEventHandler' C:\Documents and Settings\Enor\My Documents\Visual Studio 2008\Projects\ConsoleApplicationProva1\ConsoleAppl icationProva1\Program.cs 19 46 ConsoleApplicationProva1
does anybody know how to deal with this?
Thakns in advance