I'm trying to get the value of a check box from an Excel sheet. I found something that appears to come close, but it falls short:
xl.OLEObjects oleObjects = AddressWorksheet.OLEObjects() as xl.OLEObjects;
foreach (xl.OLEObject item in oleObjects)
{
//VBE.CheckBox xlCB = item.Object as VBE.CheckBox;
var xlCB = item.Object as VBE.CheckBox;
Console.WriteLine("checkbox: " + item.Name);
Console.WriteLine("Value: " + xlCB.get_Value());
Marshal.ReleaseComObject(xlCB); xlCB = null;
}
This gives me an error of "Unable to get the Object property of the OLEObject class"
Is there anything that actually works though? Seems like it's something you should be able to do.