Hello

I'm writing a vb.net program in which I read some information from a defined worksheet.

The size of the information varies according to the month it is running for. Meaning there are 12 values if its running in December but there is only 1 value if it runs in January.
The program should get the values into a 2-dimensional array:

Please Login or Register  to view this content.
When lastCol>7 there is no problem, and it reads perfect (it was designed for November). But for lastCol=7 (January) the program throws the following Exception:

Unable to cast object of type 'System.Double' to type 'System.Object[,]'.

Which means it is reading as a number, how can I get it to read/write as an array so I don't have to make a lot of exceptions?

Thanks