ByteScout Spreadsheet SDK – C# – Convert XLS to XLSX

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

ByteScout Spreadsheet SDK – C# – Convert XLS to XLSX

Program.cs

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

namespace CSharp
{
    class Program
    {
        static void Main(string[] args)
        {
			// Open existing XLS file
            Spreadsheet spreadsheet = new Spreadsheet();
			spreadsheet.LoadFromFile("Input.xls");

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

            // Save document
            spreadsheet.SaveAs("Output.xlsx");

            // Close Spreadsheet
            spreadsheet.Close();

            // open generated XLSX document in default program
            Process.Start("Output.xlsx");

        }
    }
}


  Click here to get your Free Trial version of the SDK

Tutorials:

prev
next