strange behavior by ActiveX controls

P

Paul James

I've got some ActiveX controls in my workbook, and their click events
trigger some VBA code that I've written. When I click on these controls,
the code runs as expected. However, strange things happen to these controls
themselves after I've clicked on them:

1. The caption font gets smaller after every several clicks of the control.
For example, if I originally set the caption font size to 14, as I click on
the controls, the font size gets smaller until its unreadable, smaller than
1 point. Even if I reset the font size in the control's properties window,
the caption font doesn't respond to the new setting. It remains at the
smallest size it reached while I was clicking on the control.

2. In the case of the command buttons, after I click on and then release the
button, they sometimes remain depressed instead of popping back up when I
release the mouse. I can then continue to operate the button, but their
display state is then reversed, where the button raises up when you click
the mouse, and drops back down when you release it.

Does anyone know what's going on with this?

Thanks in advance.

Paul
 
P

Paul James

I'll also mention that there's nothing in the code that's being run in the
click event of these controls that affects the ActiveX objects themselves.
That is, I'm not resetting any of the properties of the controls, or moving
or resizing any ranges in the sheets where the controls reside. The code
simply copies data from one place in the worksheet to another place. So I
don't think the code that's being run is causing the bizzare behavior I've
described.
 
T

Tim Zych

Is this being used on a worksheet?

The only time I saw this bug was while using XL97. I think the way I fixed
it was to recreate the button and make it a bit larger/smaller until it no
longer happened.

ActiveX controls on worksheets can be finicky. I try to avoid using them
wherever possible and use Forms controls instead.
 
P

Paul James

Yes, the ActiveX controls I described are in a worksheet in Excel 2002.
After experiencing this, I too am going to use Forms controls whenever
possible.

I wonder what's up with Microsoft - if this type of thing reared its head in
Excel 97, they must have known about it, and it's surprising they still
haven't fixed it two major upgrades later.
 

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