I am having a problem where the cells object doesn't include cells that are empty. I need them to be available for my loops to work correctly while passing data to the db.
wwWhen the initial spreadsheet is completely filled out everything works perfect but when a cell is left blank in the initial spreadsheet it also isn't included in the 'cells' object. I found that adding borders to the original spreadsheet fixed the problem but I really can't ask my end users to format their spreasdsheets.
Here is an example that I can't get to see the empty cells, how would I fix this? (ps, thanks for the help!!!)
Workbook wb = new Workbook();
wb.Open(fileio.FileContent);
Cells cells = wb.Worksheets[0].Cells;
int iTotal = cells.MaxDataColumn * cells.MaxDataRow + strHeaders.Length - 1;
</p><p>string strCell, strHeader;</p><p>for (int iCnt = strHeaders.Length - 1; iCnt < iTotal; )
</p><p>{
</p><p> for (int iCol = 0; iCol < strHeaders.Length; iCol++)
{
strHeader = strHeaders[iCol];
strCell = cells[++iCnt].StringValue;
dat.AddParameter(strHeader, strCell); //this is where the blank cells are needed.
}
iRowCount++;
}