title: Object Error: This Key is already associated with an element of this collection
body: <p><strong>Explanation:</strong>
  I looked up already some answers to this question, but they don´t suite my case.
  I am trying to Write a solution for Hex To Binary conversion in VBA, but I get an error mentioned in the title. While I cannot find any other Key that is associated with this element in this collection. </p>
  
  <p><strong>My CODE:</strong></p>
  
  <pre><code>Public Function HEX2BIN(strHex As String) As String
      Dim oHexValues As Object
      Dim valueBin As String
      Dim l_strHex As Integer
      Set oHexValues = CreateObject("Scripting.Dictionary")
  
  
      oHexValues.Add 1, "0001"
      oHexValues.Add 2, "0010"
      oHexValues.Add 3, "0011"
      oHexValues.Add 4, "0100"
      oHexValues.Add 5, "1010"
      oHexValues.Add 6, "0110"
      oHexValues.Add 7, "0111"
      oHexValues.Add 8, "1000"
      oHexValues.Add 9, "1001"
      oHexValues.Add A, "1010"
      oHexValues.Add B, "1011"
      oHexValues.Add C, "1100"
      oHexValues.Add D, "1101"
      oHexValues.Add E, "1110"
      oHexValues.Add F, "1111"
  
  valueBin = ""
  l_strHex = Len(strHex)
  
  For i = 1 To l_strHex
      charHex = Mid(strHex, i, 1)
      MsgBox "Chars:" &amp; charHex
      If oHexValues.Exists(charHex) Then
          valueBin = valueBin &amp; oHexValues(charHex)
      ElseIf charHex = "0" Then
          valueBin = valueBin &amp; "0000"
      Else
          MsgBox "Invalid value!"
      End If
  Next i
  HEX2BIN = valueBin
  
  End Function
  </code></pre>
  
  <p><strong>ERROR:</strong> <em>This Key is already associated with an element of this collection</em>. And the debugger points to the entry:</p>
  
  <pre><code>oHexValues.Add B, "1011"
  </code></pre>
  
  <p>Can anyone help me out here?</p>