1

I have searched the net but cannot seem to find what I need. I am creating an application where I detect all the Excel Applications currently running in the system. It is returned through a class by indexers:

ExcelAppsInMemory excelAppsInMemory= new ExcelAppsInMemory();
for(int i=0; i<excelAppsInMemory.Count; i++)
{
   excelAppsInMemory[i].WorkbookOpen += new Excel.AppEvents_WorkbookOpenEventHandler(frmDirtyExcel_WorkbookOpen);
}

Well, you have guessed it right... it dosen't work. So, how do I create event handlers for Workbook events for excel applications that are captured during runtime.

Thanks in advance

  • http://stackoverflow.com/questions/2926205/does-every-excel-interop-object-need-to-be-released-using-marshal-releasecomob?rq=1 – kd. Sep 12 '13 at 15:04
  • @kd. the link is for releasing com object reference, my question was regarding creating event handlers during runtime –  Sep 12 '13 at 15:11
  • what exactly are you trying to achieve? – kd. Sep 12 '13 at 15:33
  • @kd. Simply speaking : Create Excel event handlers during runtime, (the count of excel apps is not fixed and is only known during runtime). –  Sep 12 '13 at 16:04

0 Answers0