VBA从收藏中获取价值? [英] VBA getting values from a collection?
本文介绍了VBA从收藏中获取价值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我对VBA非常新鲜,我无法弄清楚如何从集合中获取值。
I am very new to VBA and I can not figure out how to get values from a Collection.
这是我的代码:
Dim p As Object
Set p = JSON.parse(Response.Content)
Dim links As Object
Set links = p.Item("links")
在链接的调试器中请参阅:
In the debugger for "links" I see:
我正在使用这个库解析json: http://www.ediy.co.nz/vbjson-json-parser-library-in-vb6-xidc55680.html
I am using this library to parse json : http://www.ediy.co.nz/vbjson-json-parser-library-in-vb6-xidc55680.html
我在json中的部分是:
The part I have in json is:
"links":[
{
"rel":"next",
"href":"www.google.com"
}
]
如何在这里获取rel的值?
How can I get the value of "rel" here?
推荐答案
不要忘了bang操作员,设计用于通过密钥进行收集访问:
Don't forget the bang operator, designed for collection access by key:
links(1)!rel
或:
links(1)![rel] 'When there are spaces or reserved words.
这篇关于VBA从收藏中获取价值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文