Can't get Control.State to work
Indeed you originally said you were adding the button with Customize, sorry
I should have read your OP better. But why not add the bar and buttons each
time in the workbook's open event, and delete in the close. That's the
normal way, not difficult, will give you a lot more control and solve your
State problem.
Regards,
Peter T
PS, in the open event start by running the code to delete the old bar, just
in case it wasn't in the last close event.
"wal" wrote in message
...
Right-click-on-control-bars Customize...
Control.State appears to be read-only for such buttons.
Thanks to all for all the input. I'll have to decide whether I want
to reconstruct a button upon Open or not.
On Mar 29, 4:30 pm, "Peter T" wrote:
"GS" wrote in
...
I suspect the OP is using a custom toolbar created via the 'Customize'
dialog. If so then setting 'State' has no effect, though no error is
generated by attempting to set this property.
Attempting to do same with any of the built-in commandbars generates an
'automation' error.
That wouldn't have occurred to me but on checking, indeed as you say, a
button added that way doesn't seem to respond to State. However a button
added programmatically to a built-in bar does respond to State.
OP, how did you add your button?
Regards,
Peter T
|