Exemplo n.º 1
0
 /// <summary>
 /// Returns the control with the specified name in the specified worksheet.
 /// </summary>
 /// <param name='name'>Name of the control to find.</param>
 /// <param name='sheet'>Worksheet object that contains the control.</param>
 /// <returns>
 /// Returns the specified control, or null if it is not found.
 /// </returns>
 object FindControl(string name, Excel.Worksheet sheet )
 {
     Excel.OLEObject theObject;
     try
     {
         theObject = (Excel.OLEObject) sheet.OLEObjects(name);
         return theObject.Object;
     }
     catch
     {
         // Returns null if the control is not found.
     }
     return null;
 }