Hello, I have 20 scrollbar activex controls on a sheet that allow users to adjust different metrics and I'm trying to change a set of properties for all of them instead of going into each one individually. The code I have so far is like this:
Sub AdaptScrollBars()
Dim sh As Shape
For Each sh In ActiveSheet.Shapes
If sh.Type = msoOLEControlObject Then
If TypeName(sh.OLEFormat.Object.Object) = "ScrollBar" Then
With sh.OLEFormat.Object.Object
.Orientation = Vertical
.Height = 100.2
.Width = 13.8
.BackColor = RGB(2, 20, 56)
.ForeColor = RGB(255, 255, 255)
.Max = 1000
End With
End If
End If
Next
End Sub
It says object doesn't support this property or method, just trying to figure out if I am very far off or need to research more? already doing this but haven't found solution yet. Any advice would be welcome, thank you,
Rayburn
Sub AdaptScrollBars()
Dim sh As Shape
For Each sh In ActiveSheet.Shapes
If sh.Type = msoOLEControlObject Then
If TypeName(sh.OLEFormat.Object.Object) = "ScrollBar" Then
With sh.OLEFormat.Object.Object
.Orientation = Vertical
.Height = 100.2
.Width = 13.8
.BackColor = RGB(2, 20, 56)
.ForeColor = RGB(255, 255, 255)
.Max = 1000
End With
End If
End If
Next
End Sub
It says object doesn't support this property or method, just trying to figure out if I am very far off or need to research more? already doing this but haven't found solution yet. Any advice would be welcome, thank you,
Rayburn