ByteScout Spreadsheet SDK – C# – Convert XLS to XML

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

ByteScout Spreadsheet SDK – C# – Convert XLS to XML

Program.cs

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

namespace Converting_XLS_to_XML
{
    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.xml")){
                File.Delete("SimpleReport.xml");
            }

      document.Workbook.Worksheets[0].SaveAsXML("SimpleReport.xml");
      document.Close();

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


        }
    }
}


  Click here to get your Free Trial version of the SDK

prev
next