W
Will Morgan
I am trying to add a GotFocus Handler to OLEObject in excel and it will
always trip and exception.
The following code snippet show how I'm handling the event. It blows at the +=
Excel._Application ExcelApp =
(Excel._Application)applicationObject;
Excel.Worksheet activeWorksheet =
(Excel.Worksheet)ExcelApp.ActiveSheet;
Excel.OLEObjects objCollection =
(Excel.OLEObjects)activeWorksheet.OLEObjects(Type.Missing);
Excel.OLEObjectEvents_GotFocusEventHandler hand = new
Excel.OLEObjectEvents_GotFocusEventHandler(objOle_GotFocus);
Excel.OLEObject objBarcode =
objCollection.Add("Barcodefactory.Barcode", null, null, null, null, null,
null, curSel.Left, curSel.Top, curSel.Width, curSel.Height);
objBarcode.GotFocus += hand;
Thanks,
Will Morgan
always trip and exception.
The following code snippet show how I'm handling the event. It blows at the +=
Excel._Application ExcelApp =
(Excel._Application)applicationObject;
Excel.Worksheet activeWorksheet =
(Excel.Worksheet)ExcelApp.ActiveSheet;
Excel.OLEObjects objCollection =
(Excel.OLEObjects)activeWorksheet.OLEObjects(Type.Missing);
Excel.OLEObjectEvents_GotFocusEventHandler hand = new
Excel.OLEObjectEvents_GotFocusEventHandler(objOle_GotFocus);
Excel.OLEObject objBarcode =
objCollection.Add("Barcodefactory.Barcode", null, null, null, null, null,
null, curSel.Left, curSel.Top, curSel.Width, curSel.Height);
objBarcode.GotFocus += hand;
Thanks,
Will Morgan