What is the best VBA data type`key`=>`value` to save data same as PHP array

前端 未结 2 588
忘了有多久
忘了有多久 2021-02-07 15:02

I\'m working with VBA and need to save data in type key=>value to getting fastest; This data type help me cache responese text from http request, incre

2条回答
  •  梦谈多话
    2021-02-07 15:29

    Above answer will not work because of wrong syntax you need to add Scripting Keword before also enable Microsoft Sripting Run Time I tried it with and Without Sripting. before Dictionary in MS word(2016) and without dosen't work even if you have enabled Microsoft Scripting runtime

     Dim dict As Scripting.Dictionary
     Set dict = New Scripting.Dictionary
     dict.Add "John", 34
     dict.Add "Jane", 42
     dict.Add "Ted", 402
    
     Debug.Print "Number of items stored: " & dict.Count
     Debug.Print "Ted is " & dict.Item("Ted") & " years old"
    

提交回复
热议问题