我遇到了最后一行的类型不匹配错误。有什么想法吗?
Dim language As String
Dim langOps(0 To 2) As String
If CheckBox10.Value = True Then
langOps(0) = CheckBox10.Caption
End If
If CheckBox15.Value = True Then
langOps(1) = CheckBox15.Caption
End If
If CheckBox29.Value = True Then
langOps(2) = CheckBox29.Caption
End If
language = Join(langOps, [, ])
答案 0 :(得分:1)
""
不是[]
language = Join(langOps, ", ")
([]
是评估的简写语法,[,]
计算错误,该错误无法强制转换为字符串join
因此错误)
答案 1 :(得分:1)
失败,因为您使用方括号>> []
<<而是引用""
。
language = Join(langOps, [, ])
>>>错
language = Join(langOps, ", ")
>>>右