What my code is trying to accomplish is copying all the cells from one worksheet into another. It is the simple block
// find the index of the first empty row and column in the dumped file
int m = 1; while ( !wb.Worksheet(3).Cell(m,1).IsEmpty() ) ++m;
int n = 1; while ( !wb.Worksheet(3).Cell(1,n).IsEmpty() ) ++n;
// copy from dumped file into raw data file
for (int i = 1; i < m; ++i )
{
for (int j = 1; i < n; ++j)
{
wb.Worksheet(1).Cell(i,j).Value = wb.Worksheet(3).Cell(i,j).Value;
}
}
and somehow this is throwing the error
Column number must be between 1 and 16384
Any idea why that could be? I don't see any infinite loops or anything like that.