Hi. Can anyone help. I have a situation where I have read the contents of an excel range into a an array. When I then try to loop round that array starting at (0,0) I get the System.IndexOutOfRangeException. However, when running my program in debug mode I can watch the contents of the (0,0) and see that they are valid. Code looks a bit like this:
Dim xIncomes(30,11)
Dim x as integer
xIncomes = Excelwrkbk.ActiveSheet.Range("F7093").value
...
for x = 0 to 11
if xIncomes(0,x) = "whatever" then
...
end if
next
The exception is raised on the if statement. In debug mode I can see the contents of xIncomes(0,0)
Dim xIncomes(30,11)
Dim x as integer
xIncomes = Excelwrkbk.ActiveSheet.Range("F7093").value
...
for x = 0 to 11
if xIncomes(0,x) = "whatever" then
...
end if
next
The exception is raised on the if statement. In debug mode I can see the contents of xIncomes(0,0)