I am working on vba macros. I was trying to use a dictionary. But it is giving error 457 with debugger pointing to toprow.Add ActiveCell.value, val
I was getting the same error message: "Error This key is already associated with an element of this collection". In my case, the problem was that I had this:
'assign values to properties
Property Let EmployeeName(Valor As String)
m_employeename = Valor
End Property
Property Let EmployeeID(Valor As String)
m_employeename = Valor
End Property
I was supposed to have this:
'assign values to properties
Property Let EmployeeName(Valor As String)
m_employeename = Valor
End Property
Property Let EmployeeID(Valor As String)
m_employeeid = Valor
End Property
Maybe you just have to double check your "Property Let" code to see if you are using appropriate names for those variables that are private in your class.