LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with CommandButton vs Excel 2002


Hi,
I am fairly new at programming for Excel so please forgive my
naivety. I am trying to port an Excel workbook with macros from a
Windows machine to a Mac. After opening the workbook on the Mac I
found that none of the macros seemed to work. Upon further
investigation I found that whatever version of Excel that was used to
create the workbook used an "=EMBED("Forms.CommandButton.1","")"
construct for all of the buttons on the spreadsheet. I read several
articles on line about using command buttons and tried some of the
examples but the versions that I have (2002 on Windows and 2004 on Mac)
do not create an "=EMBED()" construct. Instead they just create a macro
call like "Sub Button1_Click()". When I went through the workbook and
deleted all of the "=EMBED()" constructs and just linked each button to
the appropriate macro it seemed to work fine on both the Windows and Mac
machines.
Now I have gotten deeper into the workbook and have found that
"=EMBED("Forms.CheckBox.1","")" and "=EMBED("Forms.OptionButton.1","")"
are also used. When I tried to create my own checkbox or option button
I found that these also did not use the "=EMBED()" construct any more
and just linked to a macro such as "Sub MyCheck_Click()" or "Sub
MyOption_Click()". With the "=EMBED()" form you could get the value of
the check box by looking at, for example, MyCheck.Value but that no
longer seems to be the way to get at the information on if the box is
checked or not. I tried the following two tests but without success.
They always return "False".

Sub MyCheck_Click()
If MyCheck = True Then
MsgBox "Checked"
ElseIf MyCheck = False Then
MsgBox "Unchecked"
Else
MsgBox "Neither state returned"
End If
End Sub

Sub MyOption_Click()
If MyOption = True Then
MsgBox "Checked"
ElseIf MyOption = False Then
MsgBox "Unchecked "
Else
MsgBox "Neither state returned "
End If
End Sub


So, my question is twofold: 1) Have things changed with respect
to the form of the "CommandButton" between versions prior to 2002 and
2002?, and 2) How do I now get to the value of the checkbox?


Thanks for your help!


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

 
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
CommandButton to open a Excel workbook aussiegirlone Excel Discussion (Misc queries) 2 March 25th 09 01:34 AM
CommandButton in Excel to open another Application JohannM Excel Worksheet Functions 0 September 13th 06 09:29 PM
Outlook 2002 calendar dates exported to Excel 2002 sort incorrectl scampbell Excel Worksheet Functions 0 February 22nd 06 06:31 PM
How do I embed a commandbutton from VisualBasic into Excel SIDAS Excel Programming 1 August 9th 05 12:40 PM
Running a CommandButton in Excel I get this error Bert[_4_] Excel Programming 4 May 5th 04 07:06 PM


All times are GMT +1. The time now is 07:22 PM.

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"