In the code below I read through a smartsheet from column to column running some code until it throws an outofrange exception whereby I make the cellNumber = 0, and increase the row number (in other words move to a new line).
while (rowNumber < totalRows)
{
try
{
do code....
cellNumber++
} catch (System.ArgumentOutOfRangeException)
{
cellNumber = 0;
rowNumber++;
}
}
Is there anyway to only catch the out of range exception associated with cellNumber?