There is a log try before the SaveAs (actually right before the connection is closed & disposed) and then one right afterwards as shown below:
.
.
.
.
indcell = "F" + i.ToString();
worksheet.Cell(indcell).Value = mySQLReader["Qty"];
indcell = "G" + i.ToString();
worksheet.Cell(indcell).Value = mySQLReader["PieceWork"];
i = i + 1;
}
string s18 = "Finished looping to populate spreadsheet...";
Log(s18);
mySQLReader.Close();
mySQLReader.Dispose();
workbook.SaveAs(fn);
string s19 = "SAVED the spreadsheet!!!";
Log(s19);
}
else
{
string s20 = "No spreadsheet to save due to no data.";
Log(s20);
}
.
.
.
.
indcell = "F" + i.ToString();
worksheet.Cell(indcell).Value = mySQLReader["Qty"];
indcell = "G" + i.ToString();
worksheet.Cell(indcell).Value = mySQLReader["PieceWork"];
i = i + 1;
}
string s18 = "Finished looping to populate spreadsheet...";
Log(s18);
mySQLReader.Close();
mySQLReader.Dispose();
workbook.SaveAs(fn);
string s19 = "SAVED the spreadsheet!!!";
Log(s19);
}
else
{
string s20 = "No spreadsheet to save due to no data.";
Log(s20);
}