Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamically added control Excel sheet suddenly freezing/unresponsive and can't view properties.

Status
Not open for further replies.

wekkew

Programmer
Sep 28, 1998
123
0
0
GB
Ok, code adds togglebutton (Forms.ToggleButton.1) and event to Excel worksheet - code was working fine, no problems... and then for some reason I can't fathom... the toggle button will no longer respond. It's not locked, it's enabled - so should be able to press/depress it with a mouse click but it's dead to the world.

The other weird thing is that when I try to view the properties for the recently added toggle, all I get is the properties for the worksheet! Most peculiar. It's def NOT the code, because in another workbook it works exactly as it should and I can see the properties.

So, I'm guessing I've unwittingly set some ws/project property - anyone help?

ta
 
Hi,

I've almost always managed to avoid adding controls on the fly.

Have you considered adding the control at design time and then making the control visible or not in your code?
 
You can see properties of the activex control on worksheet only in design mode.

combo
 
well after wasting most of yesterday on this... the penny finally dropped today!

The dynamically added ws + controls are arranged with the main data ws (so I had a workbook.xlsm:1 and workbook.xlsm:2 window configuration), and it was that which was causing the problems! If you click a dynamically added control on a :2 window - it's dead! View it in single window and hey presto - it's alive and working!

Live and learn and all that.

[agree with what you say about avoiding dynamically created ws, controls. If I had my way :) this would be a hidden sheet, all set up as required and then copied when needed]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top