Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
excelvba访问数组_Vba_Excel - Fatal编程技术网

excelvba访问数组

excelvba访问数组,vba,excel,Vba,Excel,我似乎无法访问项目0: 我尝试了多种访问ComID的方法,例如: ComID = response.Result.PartData.PartList.PartDto.Item(0).ComID OR ComID = response.Result.PartData.PartList.PartDto.(0).ComID OR ComID = response.Result.PartData.PartList.PartDto.0.ComID 这在PartDto之前一直有效,但我

我似乎无法访问项目0:

我尝试了多种访问ComID的方法,例如:

 ComID = response.Result.PartData.PartList.PartDto.Item(0).ComID  OR
 ComID = response.Result.PartData.PartList.PartDto.(0).ComID      OR
 ComID = response.Result.PartData.PartList.PartDto.0.ComID
这在PartDto之前一直有效,但我正在努力访问项0

我的备份解决方案是循环PartDto中的每个项,这可以工作,但必须有更好的方法


谢谢你的帮助

如果您正在钻研一系列嵌套的词典或集合,那么不必像引用项(键0)一样将它们作为父项引用吗?您应该在文章中应用一些上下文。我假设
response
responseText
,它是由库转换的JSON字符串。我的答案可能有用。@TinMan我不是VBA专家,所以谢谢你的耐心。我已经试过了:
ComID=response.Result.PartData.PartList.PartDto(1.ComID
ComID=response.Result.PartData.PartList.PartDto.Keys()(1.ComID)
,这两种方法都不起作用。@Jeeped问了这个问题。你应该看看我的帖子。
TypeName(response.Result.PartData.PartList.PartDto)
返回什么?@TinMan“jscript类型信息”