常量二维数组访问VBA

时间:2018-04-17 18:46:29

标签: vba ms-access multidimensional-array constants

是否可以仅使用访问权限在VBA中创建一个常量二维数组? 我试过了:

Const s1 As String = [{"a","b","c";"1","2","3"}]

来自How to initialize a multidimensional array variable in vba for excel

Const s2 as variant = array(array("a","b","c"),array("1","2","3"))

但是都不行。我查看它们是否作为常规声明工作。

Dim s1 As String = [{"a","b","c";"1","2","3"}]

失败,似乎是因为我没有使用Excel。

dim s2 as variant = array(array("a","b","c"),array("1","2","3")) 

成功。

0 个答案:

没有答案