I've looked up other posts on this error code but I still can't figure out my problem.
I've reduced my code to just a few lines.
I get the message box with k (18 is the number of elements in the spreadsheet and this is what I get from the message box) but then the error message appears. It appears that I can't access the items in the array.
Excel 2010
I've reduced my code to just a few lines.
Code:
Dim EastingArr As Variant
Dim k as Long
EastingArr = Workbooks("Area Calculations.xlsm").Worksheets("Sheet1").Range("Easting")
k = UBound(EastingArr)
MsgBox (k)
MsgBox (EastingArr(1))
I get the message box with k (18 is the number of elements in the spreadsheet and this is what I get from the message box) but then the error message appears. It appears that I can't access the items in the array.
Excel 2010