OptionButtons per VBA: Automation Error
Sven
ich hab grad das Problem, dass ich in einer langen Liste in einem Arbeitsblatt Optionbuttons _ per VBA hinzufügen möchte. Dazu benutze ich folgenden Code:
With ActiveSheet
For i = 2 To ende
.OLEObjects.Add(ClassType:="Forms.OptionButton.1", Link:=False, DisplayAsIcon:=False, _
_
Left:=Cells(i, 10).Left, Top:=Cells(i, 10).Top, Width:=Cells(i, 10).Width, Height:=Cells(i, 10). _
Height).Name = "move" & i
ActiveSheet.OLEObjects("Move" & i).Object.GroupName = "Gruppe" & i
ActiveSheet.OLEObjects("Move" & i).Object.Caption = "Move"
.OLEObjects.Add(ClassType:="Forms.OptionButton.1", Link:=False, DisplayAsIcon:=False, _
_
Left:=Cells(i, 11).Left, Top:=Cells(i, 11).Top, Width:=Cells(i, 11).Width, Height:=Cells(i, 11). _
Height).Name = "zip" & i
ActiveSheet.OLEObjects("zip" & i).Object.GroupName = "Gruppe" & i
ActiveSheet.OLEObjects("zip" & i).Object.Caption = "Zip"
Next i
End With
'ende' wird dabei mittels
ende = .Cells(Rows.Count, 1).End(xlUp).Row
ermittelt.
Die Liste mit der ich teste umfasst 1133 Zeilen - und bei Zeile 605 tritt der Fehler auf. Optionbutton "Move605' wird noch korrekt erstellt, 'Zip605' jedoch nicht mehr.
Hat jemand eine Idee was da falsch läuft? Vielen Dank im Voraus.... ;)