View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
YoungGuy[_2_] YoungGuy[_2_] is offline
external usenet poster
 
Posts: 1
Default Help with CommandButton vs Excel 2002


David,
You're right. I finally found a reference that says that ActiveX
controls, which are employed by the "Command Toolbox" and which use the
embedded object scheme "=EMBED()", are not available on Mac versions of
Excel. It seems that all of these embedded objects need to be changed
to "Form" buttons, check boxes, and option buttons. I've put together
a short section of code to switch option buttons on and off. I am
having trouble switching just one button off. When I set the button to
xlOff, all of the buttons turn off. The method seems to work fine if I
use a check box. What I would like to do in the end with the option
buttons is put out a set of discrete choices with an option button next
to each. When a particular option button is selected I want to turn all
the other ones off.

Sub TestButton2_Click()
Dim myButton1 As OptionButton
Set myButton1 = ActiveSheet.OptionButtons(Application.Caller)

If myButton1.Value = xlOn Then
Call MsgBox("Checked")
ElseIf myButton1.Value = xlOff Then
Call MsgBox("Unchecked")
Else
Call MsgBox("Neither")
End If
myButton1.Value = xlOff
End Sub

Sub TestButton3_Click()
Dim myButton3 As OptionButton
Set myButton3 = ActiveSheet.OptionButtons(Application.Caller)

If myButton3.Value = xlOn Then
Call MsgBox("Checked")
ElseIf myButton3.Value = xlOff Then
Call MsgBox("Unchecked")
Else
Call MsgBox("Neither")
End If
End Sub

When I select TestButton2, a message displays showing that TestButton2
is on, and then both buttons reset when I only want TestButton2 to
reset.
Help!


--
YoungGuy
------------------------------------------------------------------------
YoungGuy's Profile: http://www.excelforum.com/member.php...o&userid=29654
View this thread: http://www.excelforum.com/showthread...hreadid=493663