Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Retrieving the state of a checkbox (form type) from VB .NET?

Hi,

I'm hoping someone here has the saavy to solve this problem. I can't figure
out how to get the state of a checkbox (the Form-type) from VB.NET.

I can get the state of the Control Toolbox version just fine.

Here's my code for the control-type checkbox

Dim testOLE As Excel.OLEObject
testOLE = oWorkSheet.OLEObjects("CheckBox1")

However, this won't work with the Form-type, so I'm assuming the Form-type
is an OLEObject, but I no idea what it could be (a shape object?).

Anyone have any ideas what its handle might be? And yes, I have to use the
form-type. Help would be appreciated
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Retrieving the state of a checkbox (form type) from VB .NET?

I don't use vb.net, but if I were doing it in excel, I'd do:

dim testCBX as excel.checkbox
set testcbx = oworksheet.checkboxes("check box 1")

(checkboxes from the Forms toolbar usually have slightly different spellings
(extra spaces). So be a little careful.)



moogleii wrote:

Hi,

I'm hoping someone here has the saavy to solve this problem. I can't figure
out how to get the state of a checkbox (the Form-type) from VB.NET.

I can get the state of the Control Toolbox version just fine.

Here's my code for the control-type checkbox

Dim testOLE As Excel.OLEObject
testOLE = oWorkSheet.OLEObjects("CheckBox1")

However, this won't work with the Form-type, so I'm assuming the Form-type
is an OLEObject, but I no idea what it could be (a shape object?).

Anyone have any ideas what its handle might be? And yes, I have to use the
form-type. Help would be appreciated


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Retrieving the state of a checkbox (form type) from VB .NET?

Hmm thanks for the help, but the code didn't work for me.

checkbox didn't seem to be a member of excel.

After tons of searching, i've found out that apparently the Form-type
checkboxes are based on XLM, while the Control-type checkboxes are ADO. XLM
was phased out, but I think there may still be a way to access them with the
Excel 5.0 library.

Anyone have any ideas?

"Dave Peterson" wrote:

I don't use vb.net, but if I were doing it in excel, I'd do:

dim testCBX as excel.checkbox
set testcbx = oworksheet.checkboxes("check box 1")

(checkboxes from the Forms toolbar usually have slightly different spellings
(extra spaces). So be a little careful.)



moogleii wrote:

Hi,

I'm hoping someone here has the saavy to solve this problem. I can't figure
out how to get the state of a checkbox (the Form-type) from VB.NET.

I can get the state of the Control Toolbox version just fine.

Here's my code for the control-type checkbox

Dim testOLE As Excel.OLEObject
testOLE = oWorkSheet.OLEObjects("CheckBox1")

However, this won't work with the Form-type, so I'm assuming the Form-type
is an OLEObject, but I no idea what it could be (a shape object?).

Anyone have any ideas what its handle might be? And yes, I have to use the
form-type. Help would be appreciated


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Retrieving the state of a checkbox (form type) from VB .NET?

It did work ok for me in excel's VBA.

How about going through the shapes collection.

This also worked for me in excel's VBA:

Dim myShape As Excel.Shape
Set myShape = ActiveSheet.Shapes("check box 1")
MsgBox myShape.OLEFormat.Object.Value
'or
MsgBox myShape.ControlFormat.Value

No guess if it'll work in .Net.

moogleii wrote:

Hmm thanks for the help, but the code didn't work for me.

checkbox didn't seem to be a member of excel.

After tons of searching, i've found out that apparently the Form-type
checkboxes are based on XLM, while the Control-type checkboxes are ADO. XLM
was phased out, but I think there may still be a way to access them with the
Excel 5.0 library.

Anyone have any ideas?

"Dave Peterson" wrote:

I don't use vb.net, but if I were doing it in excel, I'd do:

dim testCBX as excel.checkbox
set testcbx = oworksheet.checkboxes("check box 1")

(checkboxes from the Forms toolbar usually have slightly different spellings
(extra spaces). So be a little careful.)



moogleii wrote:

Hi,

I'm hoping someone here has the saavy to solve this problem. I can't figure
out how to get the state of a checkbox (the Form-type) from VB.NET.

I can get the state of the Control Toolbox version just fine.

Here's my code for the control-type checkbox

Dim testOLE As Excel.OLEObject
testOLE = oWorkSheet.OLEObjects("CheckBox1")

However, this won't work with the Form-type, so I'm assuming the Form-type
is an OLEObject, but I no idea what it could be (a shape object?).

Anyone have any ideas what its handle might be? And yes, I have to use the
form-type. Help would be appreciated


--

Dave Peterson


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you assess the state of a form-checkbox in a logic statemen jvatlanta Excel Worksheet Functions 1 August 4th 09 05:13 PM
State abbrev. TN changes to ten can not type TN as abbre. teresac Excel Worksheet Functions 3 January 5th 09 09:09 PM
How To Get The State Of A CheckBox Minitman[_4_] Excel Programming 13 October 27th 04 09:37 PM
Retrieving Default Chart Type? NooK[_21_] Excel Programming 2 July 1st 04 07:25 AM
testing the state of a checkbox in vba code Paul James[_3_] Excel Programming 10 December 5th 03 07:55 PM


All times are GMT +1. The time now is 08:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"