Strange behavior in Excel 2003

  • Thread starter The poster formerly known as Colleyville Alan
  • Start date
T

The poster formerly known as Colleyville Alan

I recently posted about an application that I developed in Excel 2000 that
did not work in Excel 2003. For one thing, the checkbox.name property in
Excel 2000 is not available to VBA in 2003. I was able to get the name by
checking the object type and if it was a textbox, getting the object name.

It seems strange that MS would remove the name property from VBA, but here
is something even more strange. I had code that looped through all of the
objects on the screen. It would test the object using the "typeof" command.
If the object was a textbox, it did one action, if not, the action was
skipped. This, too, worked fine in Excel 2000. However, in Excel 2003,
when the code looked at an OptionButton and tested to see if it was a
CheckBox, the result came back True!

If the progam was looking at a CheckBox and I asked if it was an
OptionButton, I would get a value of False. But when it looked at
OptionButtons and asked if they were CheckBoxes, it said true. So I had two
if statements, one that had a goto <label> built-in in case it was an
OptionButton and the second one for the normal processing. I did not have
anything this strange happen in Excel 2000.

Anybody else know about this? Is this a well-known bug that I am just now
encountering?
 
J

Jim Rech

Anybody else know about this? Is this a well-known bug that I am just now
encountering?

No. No.

If you'd like to send me a simple example that demos the problem I'd be
happy to look at it. However I've used these controls in both versions for
many years and not seen any problems like you've experienced.

Oh, please, Alan and everyone - when you post about option buttons and check
boxes PLEASE mention which toolbar they come from. There are two types -
Forms toolbar and Control Toolbox and they are way different.

--
Jim
message |I recently posted about an application that I developed in Excel 2000 that
| did not work in Excel 2003. For one thing, the checkbox.name property in
| Excel 2000 is not available to VBA in 2003. I was able to get the name by
| checking the object type and if it was a textbox, getting the object name.
|
| It seems strange that MS would remove the name property from VBA, but here
| is something even more strange. I had code that looped through all of the
| objects on the screen. It would test the object using the "typeof"
command.
| If the object was a textbox, it did one action, if not, the action was
| skipped. This, too, worked fine in Excel 2000. However, in Excel 2003,
| when the code looked at an OptionButton and tested to see if it was a
| CheckBox, the result came back True!
|
| If the progam was looking at a CheckBox and I asked if it was an
| OptionButton, I would get a value of False. But when it looked at
| OptionButtons and asked if they were CheckBoxes, it said true. So I had
two
| if statements, one that had a goto <label> built-in in case it was an
| OptionButton and the second one for the normal processing. I did not have
| anything this strange happen in Excel 2000.
|
| Anybody else know about this? Is this a well-known bug that I am just now
| encountering?
|
 

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