Read from Excel CheckBox value (.NET 2.0, MS Office 2003, C#)

K

Kigorw

I try to read value from Excel checkbox but get error:

using Microsoft.Office.Interop.Excel;
using System.Reflection;
using MSForm = Microsoft.Vbe.Interop.Forms;
.........................

OLEObject theObject = null;
theObject =
(OLEObject)excelWorksheet.OLEObjects("CheckBox1"); // get object
MSForm.CheckBox cb = (MSForm.CheckBox)theObject; //
error!!! when try to cast....


Thanks for help
 
C

Cindy M.

Hi Kigorw,

I believe, if you do a Google search of all the office.developer
newsgroups, you'll find a couple of code examples that show how to
do this. It's been asked before during the last six or seven
months... Try searching the terms: ActiveX Excel
I try to read value from Excel checkbox but get error:

using Microsoft.Office.Interop.Excel;
using System.Reflection;
using MSForm = Microsoft.Vbe.Interop.Forms;
.........................

OLEObject theObject = null;
theObject =
(OLEObject)excelWorksheet.OLEObjects("CheckBox1"); // get object
MSForm.CheckBox cb = (MSForm.CheckBox)theObject; //
error!!! when try to cast....

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17
2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top