FractalWalk
Technical User
I am using Excel 2002 and have a series of shapes grouped together. Half of them are Form Control TextBoxes and half of them are freeform shapes.
I want to be able to identify the textboxes and change the properties using the mousemove event but I am having problems. Here is the code I am using:
For Each Sh In ActiveSheet.Shapes
If Sh.Type = 6 Then 'Group object
For Each tb In Sh.GroupItems
If tb.Type = 12 Then 'textbox object
tb.BackStyle = 0
End If
Next tb
Exit For
End If
Next
This code identifes each textbox but it won't allow me to use the BackStyle property against it. When I reference the individual TextBoxes by name it works. For example:
TextBox1.BackStyle = 0
That works just fine. But when I identify the object using .GroupItems it doesn't work. I need to identify each TextBox object on the fly within a loop. Any ideas?
I want to be able to identify the textboxes and change the properties using the mousemove event but I am having problems. Here is the code I am using:
For Each Sh In ActiveSheet.Shapes
If Sh.Type = 6 Then 'Group object
For Each tb In Sh.GroupItems
If tb.Type = 12 Then 'textbox object
tb.BackStyle = 0
End If
Next tb
Exit For
End If
Next
This code identifes each textbox but it won't allow me to use the BackStyle property against it. When I reference the individual TextBoxes by name it works. For example:
TextBox1.BackStyle = 0
That works just fine. But when I identify the object using .GroupItems it doesn't work. I need to identify each TextBox object on the fly within a loop. Any ideas?