command button

  • Thread starter Thread starter George
  • Start date Start date
G

George

Hi,
Can anyone tell me why there's no friggin' tag property
with the command button in Excel even though it's listed
in help?! Is there any way to store extra info with a
command button in Excel??

George R.
 
Both the forms controls and the ActiveX controls you use on the worksheet do
not have the tag property. It is only present when used on a user form.
Not sure of the reason why as my thought would also be that an ActiveX
control would expose all of it's properties, the tag being one of them.
Unless of course the ActiveX buttons used on the Worksheet are somehow
different from the ones used on the forms.

Never thought about this till this post. Anyway bottom line is tag is out
for storage when used on a form. I would put data in a named cell
underneath the commandbutton on the worksheet.

--
Regards,


Bill Lunney
www.billlunney.com
 
Bob,

It's a little complex... I'm dynamically placing buttons
on sheets and coding their click events as they're
created. I just use the button name (without the leading
cmd) to refer to what procedure the button will call when
clicked, however some procedures take parameters and
others don't. That's where I was going to use the Tag
property - if it's "" then no param, otherwise some code
indicating what I need... If there's no way to store
additional info I guess I'll just make all the procedures
with parameters and just not use them for some. I could
also hardcode the name of the procedures and their
characteristics but I wanted to make it more flexible (for
possible future use). Thanks for the reply.

George
 
George,

I see the problem, the event code doesn't give that room does it?

The only thing I can think of is to create named range cells and store the
data in those cells. You can be smart and name them logically to the button,
and then read their values in the button event code.

Anyway, good luck with it.
 
The activeX controls themselves do not have a tag property. They inherit it
from the container object (the control object on a userform). In a
worksheet they are contained in an OleObject which does not have a TAG
property.
 
Back
Top