A beolvasást áttettem a GetCellValues-ba:
public void GetCellValues(string fileName, string sheetName)
{
...
// Éjjel
addressName = "B4";
Cell theCell = wsPart.Worksheet.Descendants<Cell>().Where(c => c.CellReference == addressName).FirstOrDefault();
// If the cell does not exist, return an empty string.
if (theCell != null)
{
adat = theCell.InnerText;
if (adat != "") ejszaka_min = int.Parse(adat);
else
{
MessageBox.Show("Az éjszakai minimum hőmérséklet nincs kitöltve");
hiba = true;
return;
}
}
addressName = "C4";
theCell = wsPart.Worksheet.Descendants<Cell>().Where(c => c.CellReference == addressName).FirstOrDefault();
...
}
Így már jó(bb)?
Freeware, és akciós programok egy helyen https://www.facebook.com/freewarenews