Skip to content

Instantly share code, notes, and snippets.

@anakahala
Last active December 21, 2021 02:02
Show Gist options
  • Select an option

  • Save anakahala/d7cee31d8d4270464278873b63f1f56b to your computer and use it in GitHub Desktop.

Select an option

Save anakahala/d7cee31d8d4270464278873b63f1f56b to your computer and use it in GitHub Desktop.
ClosedXMLSample2
using ClosedXML.Excel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ClosedXmlSample
{
class Program
{
static void Main(string[] args)
{
string cellValue = "";
using (var book = new XLWorkbook(@"C:\work\sample.xlsx"))
{
var sheet = book.Worksheet(1);
var firstCellUsed = sheet.FirstCellUsed();
cellValue = firstCellUsed.Value.ToString();
}
Console.WriteLine(cellValue);
Console.ReadLine();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment