Read XLS using C# with Bytescout Spreadsheet SDK - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

Read XLS using C# with Bytescout Spreadsheet SDK

  • Home
  • /
  • Read XLS using C# with Bytescout Spreadsheet SDK

Read XLS, XLSX, CSV from C#
in your ASP.NET applications.

Bytescout Spreadsheet SDK is a clean and simple API to read XLS, XLSX, CSV files from C# (C Sharp).

Reading data from XLS and other Excel files is the ability needed in almost every business application. Using Bytescout Spreadsheet SDK is a simple way of reading Excel files using C# even without MS Excel installed.

With the Spreadsheet SDK, you can read XLS, XSLX, CSV, ODS files in C#.

Sample source code – read XLSX in C#:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using System.Collections.Generic;
using System.Text;
using Bytescout.Spreadsheet;
 
<span data-scayt_word="namespace" data-scaytid="34">namespace</span> <span data-scayt_word="HelloWorld" data-scaytid="35">HelloWorld</span>
{
    class Program
    {
        static void Main(string[] <span data-scayt_word="args" data-scaytid="36">args</span>)
        {
            // Create new Spreadsheet
            Spreadsheet document = new Spreadsheet();
    document.LoadFromFile("Hello_world.xlsx");
 
            // Get worksheet
            Worksheet worksheet = document.Workbook.Worksheets.ByName("<span data-scayt_word="Sheet1" data-scaytid="32">Sheet1</span>");
 
            // 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();
        }
    }
}

Find all sample source codes for C# and ASP.NET in a free trial of Spreadsheet SDK. Download now!

More about Bytescout Spreadsheet SDK benefits

[socialpug_share]

Tutorials: