Link Search Menu Expand Document

Convert XLS to XLSX - C#

Spreadsheet SDK sample in C# demonstrating ‘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");

        }
    }
}

Download Source Code (.zip)

Return to the previous page Explore Spreadsheet SDK