diff --git a/File-Formats-toc.html b/File-Formats-toc.html index f2a8476db..567b2a4d0 100644 --- a/File-Formats-toc.html +++ b/File-Formats-toc.html @@ -1689,6 +1689,7 @@
  • How to set Logarithmic axis for chart in Excel document?
  • How to resolve performance issue when deleting a large number of rows?
  • How to hide columns using column name?
  • +
  • How to convert xls document to xlsx format document?
  • diff --git a/File-Formats/XlsIO/FAQ.md b/File-Formats/XlsIO/FAQ.md index 480f40187..64ad1a874 100644 --- a/File-Formats/XlsIO/FAQ.md +++ b/File-Formats/XlsIO/FAQ.md @@ -83,4 +83,5 @@ The frequently asked questions in Essential XlsIO are listed below. * [How to fix the ArgumentOutOfRangeException when accessing a large number of rows and columns?](faqs/how-to-fix-the-argument-out-of-range-exception-when-accessing-a-large-number-of-rows-and-columns) * [How to set Logarithmic axis for chart in Excel document?](faqs/how-to-set-logarithmic-axis-for-chart-in-excel-document) * [How to resolve performance issue when deleting a large number of rows?](faqs/how-to-resolve-performance-issue-when-deleting-a-large-number-of-rows) -* [How to hide columns using column name](faqs/how-to-hide-columns-using-column-name) \ No newline at end of file +* [How to hide columns using column name?](faqs/how-to-hide-columns-using-column-name) +* [How to convert xls document to xlsx format document?](faqs/how-to-convert-xls-document-to-xlsx-format-document) \ No newline at end of file diff --git a/File-Formats/XlsIO/faqs/how-to-convert-xls-document-to-xlsx-format-document.md b/File-Formats/XlsIO/faqs/how-to-convert-xls-document-to-xlsx-format-document.md new file mode 100644 index 000000000..9df421c19 --- /dev/null +++ b/File-Formats/XlsIO/faqs/how-to-convert-xls-document-to-xlsx-format-document.md @@ -0,0 +1,66 @@ +--- +title: How to convert xls document to xlsx format document |Syncfusion. +description: This page explains how to convert xls document to xlsx format document using Syncfusion .NET Excel library (XlsIO). +platform: file-formats +control: XlsIO +documentation: UG +--- + +# How to convert xls document to xlsx format document? + +The following code illustrates how to convert xls document to xlsx format document. + +{% tabs %} +{% highlight c# tabtitle="C# [Cross-platform]" %} +using (ExcelEngine excelEngine = new ExcelEngine()) +{ + IApplication application = excelEngine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; + + //Loads an xls file + FileStream fileStream = new FileStream("InputTemplate.xls", FileMode.Open, FileAccess.Read); + IWorkbook workbook = application.Workbooks.Open(fileStream); + + //Set the workbook version to xlsx + workbook.Version = ExcelVersion.Xlsx; + + //Saving the workbook as stream in xlsx format + FileStream stream = new FileStream("Output.xlsx", FileMode.Create, FileAccess.ReadWrite); + workbook.SaveAs(stream); + stream.Dispose(); +} +{% endhighlight %} + +{% highlight c# tabtitle="C# [Windows-specific]" %} +using (ExcelEngine engine = new ExcelEngine()) +{ + IApplication application = engine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; + + //Loads an xls file + IWorkbook workbook = application.Workbooks.Open("InputTemplate.xls"); + + //Set the workbook version to xlsx + workbook.Version = ExcelVersion.Xlsx; + + //Saving the workbook in xlsx format + workbook.SaveAs("Output.xlsx"); +} +{% endhighlight %} + +{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} +Using engine As ExcelEngine = New ExcelEngine() + Dim application As IApplication = engine.Excel + application.DefaultVersion = ExcelVersion.Xlsx + + 'Loads an xls file + Dim workbook As IWorkbook = application.Workbooks.Open("InputTemplate.xls") + + 'Set the workbook version to xlsx + workbook.Version = ExcelVersion.Xlsx; + + 'Saving the workbook in xlsx format + workbook.SaveAs("Output.xlsx") +End Using +{% endhighlight %} +{% endtabs %} \ No newline at end of file