ich habe ein Programm, welches in Office 2013 64-Bit läuft. Jetzt habe ich dies auf einem Laptop installiert mit Office 2016 32-Bit.
Ich erhalte eine Fehlermeldung bei folgendem Code:
Sub Kategorien_je_nach_gewähltem_Datum()
Dim objSortedList As Object
Dim objArrayList As Object
Dim arr As Variant
Dim out As Variant
Dim L As Long
Dim z1 As String
ListBox3.Clear
z1 = Sheets(ComboBox3.Value).Cells(Rows.Count, 5).End(xlUp).Row
Set objSortedList = CreateObject("System.collections.SortedList")
Set objArrayList = CreateObject("System.collections.ArrayList")
arr = Sheets(ComboBox3.Value).Range("A1:H" & z1) 'anpassen
For L = 10 To UBound(arr)
If CDate(arr(L, 2)) >= TextBox2.Value Then
If CDate(arr(L, 2)) "" Then
objSortedList(CStr(arr(L, 5))) = Array((arr(L, 5)))
End If
End If
End If
Next
If objSortedList.Count > 0 Then 'Prüfung, ob Liste gefüllt ist oder nicht
objArrayList.addrange objSortedList.getvaluelist
out = WorksheetFunction.Transpose(WorksheetFunction.Transpose(objArrayList.toarray))
With ListBox3
.List = out
.ColumnCount = 1
End With
Label29.BackColor = &H8000000F 'grau
Else
Label29.Caption = vbLf & " es sind keine Kategorien vorhanden"
Label29.BackColor = &HFF&
Exit Sub
End If
End Sub
Bei dieser Zeile "Set objSortedList = CreateObject("System.collections.SortedList")" kommt die Fehlermeldung Laufzeitfehler.... Automatierungsfehler.Könnt ihr mir bitte mitteilen, was ich machen muss, damit das läuft.
Gruss
Peter