0
If IsArray(payCsv(pay_id)) = False Then
'create tempArray
lc = 0
Debug.Print "create array"
End If
If IsArray(payCsv(pay_id)) = True Then
Debug.Print " array exists, we should be able to get ubound"
lc = UBound(payCsv(0)) - LBound(payCsv(0))
l = l + 1
End If
我使用上面的代碼,以確定我是否可以在我的二維數組上使用UBOUND(即,如果創建了第二維,獲取長度(UBOUND -VBA編譯錯誤內if語句
LBOUND)。但是,我得到一個編譯錯誤,即使條件2是錯誤的,它不會識別代碼將不相關。
我正在測試一個數組,結果是如果我註釋掉「lc = UBound payCsv(0)) - LBound(payCsv(0))「是」create array「。
如果我離開這個在那裏,我得到錯誤「編譯錯誤 - 預期數組」
這是VBA中的錯誤?
OMG ...不敢相信我錯過了那個..我會盡我所能接受答案。 – David