Link Search Menu Expand Document

Read XLSX (Office 2007) Files - C#

Spreadsheet SDK sample in C# demonstrating ‘Read XLSX (Office 2007) Files’

Program.cs
using System;
using System.Collections.Generic;
using System.Text;
using Bytescout.Spreadsheet;

namespace HelloWorld
{
    class Program
    {
        static void Main(string[] args)
        {
            // Create new Spreadsheet
            Spreadsheet document = new Spreadsheet();
	document.LoadFromFile("Hello_world.xlsx");

            // Get worksheet
            Worksheet worksheet = document.Workbook.Worksheets.ByName("Sheet1");

            // Read cell value
            Console.WriteLine("Cell (0,0) value: {0}", worksheet.Cell(0, 0).ValueAsString);

            // Write message
            Console.Write("Press any key to continue...");

            // Wait user input
            Console.ReadKey();
        }
    }
}

Download Source Code (.zip)

Return to the previous page Explore Spreadsheet SDK


Copyright © 2016 - 2021 ByteScout