using IronXL;
using System;
using System.Linq;
WorkBook workBook = WorkBook.Load("sample.xls");
WorkSheet workSheet = workBook.WorkSheets.First();
// Get range from worksheet
var range = workSheet["A2:A8"];
// Get column from worksheet
var columnA = workSheet.GetColumn(0);
// Get row from worksheet
var row1 = workSheet.GetRow(0);
// Iterate over the range
foreach (var cell in range)
{
Console.WriteLine($"{cell.Value}");
}
// Select and print every row
var rows = workSheet.Rows;
foreach (var eachRow in rows)
{
foreach (var cell in eachRow)
{
Console.Write($" {cell.Value} |");
}
Console.WriteLine($"");
}
Imports IronXL
Imports System
Imports System.Linq
Private workBook As WorkBook = WorkBook.Load("sample.xls")
Private workSheet As WorkSheet = workBook.WorkSheets.First()
' Get range from worksheet
Private range = workSheet("A2:A8")
' Get column from worksheet
Private columnA = workSheet.GetColumn(0)
' Get row from worksheet
Private row1 = workSheet.GetRow(0)
' Iterate over the range
For Each cell In range
Console.WriteLine($"{cell.Value}")
Next cell
' Select and print every row
Dim rows = workSheet.Rows
For Each eachRow In rows
For Each cell In eachRow
Console.Write($" {cell.Value} |")
Next cell
Console.WriteLine($"")
Next eachRow