简体   繁体   中英

Debug.Print 2D array Value

Hello ı have strange array as variant. I want to print Name key value but ı don't know how to declare it. I try run the line below but it can't works.

Debug.Print vBodies(0,Name) or Debug.Print vBodies(0).Name

在此处输入图像描述

This is not 100% solution but it might help to show the array fields name

          ' arr is the array to check
           Dim subarr as Variant
           For Each subarr In arr
                  Debug.Print subarr & " : " & arr(subarr)
           Next

You need to cast vBodies(0) to SldWorks.Body2 Object to access its properties

Dim swBody As SldWorks.Body2
Set swBody = vBodies(0)
Debug.Print swBody.Name

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM