Witam,mam problem z sprawdzaniem czy dana komurka w excelu jest pusta. Skrypt ma wypisać nr wiersza w którym znaiduie się wolna komurka.
using ClosedXML.Excel;
using System;
namespace WebApplication50
{
public partial class WebForm1 : System.Web.UI.Page
{
private const string Plik = "F:\\dane.xlsx";
protected void Page_Load(object sender, EventArgs e)
{
using (var workbook = new XLWorkbook())
{
var worksheet = workbook.Worksheets.Add("Arkusz 1");
int i = 3;
bool istart = false;
for (; ; )
{
if (istart == false)
{
i = 3;
istart = true;
Object dane = worksheet.Cell("A" + i);
if (dane == null)
{
Response.Write(i);
break;
}
else
{
i++;
}
}
else
{
Object dane = worksheet.Cell("A" + i);
if (dane == null)
{
Response.Write(i);
break;
}
else
{
i++;
}
}
}
}
}
}
}