ByteScout Spreadsheet SDK – C# – Convert XLS to CSV

  • Home
  • /
  • Articles
  • /
  • ByteScout Spreadsheet SDK – C# – Convert XLS to CSV

ByteScout Spreadsheet SDK – C# – Convert XLS to CSV

Program.cs

using System;
using System.Collections.Generic;
using System.Text;
using Bytescout.Spreadsheet;
using System.IO;
using System.Diagnostics;

namespace Converting_XLS_to_CSV
{
    class Program
    {
        static void Main(string[] args)
        {
      Spreadsheet document = new Spreadsheet();
	document.LoadFromFile("SimpleReport.xls");

            // delete output file if exists already
            if (File.Exists("SimpleReport.csv")){
                File.Delete("SimpleReport.csv");
            }

      document.Workbook.Worksheets[0].SaveAsCSV("SimpleReport.csv");
      document.Close();

            // open output document in default viewer
           Process.Start("SimpleReport.csv");

        }
    }
}


  Click here to get your Free Trial version of the SDK

prev
next