Error This key is already associated with an element of this collection

前端 未结 3 1543
孤城傲影
孤城傲影 2021-01-02 04:10

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

3条回答
  •  无人及你
    2021-01-02 04:48

    You can also add some very basic error handling, if all you wish to do is skip over the record throwing this error. I simply inserted the below line immediately above the one which was generating this error for me, and now it happily moves along, ignoring duplicate keys which used to throw this error.

    On Error Resume Next
    

提交回复
热议问题