View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jim McLeod Jim McLeod is offline
external usenet poster
 
Posts: 14
Default C# IMdcCheckBox.Value problem

Hi Guys

Would it be possible for you to explain the method used to set an Excel checkbox in C#. The code I have developed to create and place the checkbox within the worksheet is below

/****
Excel.OLEObjects OleObjectsObject = (Excel.OLEObjects)ExcelWorkSheet.OLEObjects(Type.M issing)
Excel.OLEObject OleControl = OleObjectsObject.Add("Forms.CheckBox.1", Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, StartLeft, InternalStartTop, 130, 10);

MSForms.CheckBox MyCheckBox
MyCheckBox = (MSForms.CheckBox)base.FindControl(OleControl.Name , ExcelWorkSheet)
/****

However, when trying to set the value of MyCheckBox.Value to true I am told the following

"Property, indexer, or event 'Value' is not supported by the language; try directly calling accessor methods 'Microsoft.Vbe.Interop.Forms.IMdcCheckBox.get_Valu e()' or 'Microsoft.Vbe.Interop.Forms.IMdcCheckBox.set_Valu e(ref object)'

This is where I am stuck.... I can't access the methods connected to this interface

If you could shed some light on this problem I would appreciate the advice

Regards

Jim