Skip to content

Commit 7c91f54

Browse files
committed
882003-Xls-to-Xlsx
1 parent b134868 commit 7c91f54

File tree

3 files changed

+60
-1
lines changed

3 files changed

+60
-1
lines changed

File-Formats-toc.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1689,6 +1689,7 @@
16891689
<li><a href="/file-formats/xlsio/faqs/how-to-set-logarithmic-axis-for-chart-in-excel-document">How to set Logarithmic axis for chart in Excel document?</a></li>
16901690
<li><a href="/file-formats/xlsio/faqs/how-to-resolve-performance-issue-when-deleting-a-large-number-of-rows">How to resolve performance issue when deleting a large number of rows?</a></li>
16911691
<li><a href="/file-formats/xlsio/faqs/how-to-hide-columns-using-column-name">How to hide columns using column name?</a></li>
1692+
<li><a href="/file-formats/xlsio/faqs/how-to-convert-xls-document-to-xlsx-format-document">How to convert xls document to xlsx format document?</a></li>
16921693
</ul>
16931694
</li>
16941695
</ul>

File-Formats/XlsIO/FAQ.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,5 @@ The frequently asked questions in Essential XlsIO are listed below.
8383
* [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)
8484
* [How to set Logarithmic axis for chart in Excel document?](faqs/how-to-set-logarithmic-axis-for-chart-in-excel-document)
8585
* [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)
86-
* [How to hide columns using column name](faqs/how-to-hide-columns-using-column-name)
86+
* [How to hide columns using column name?](faqs/how-to-hide-columns-using-column-name)
87+
* [How to convert xls document to xlsx format document?](faqs/how-to-convert-xls-document-to-xlsx-format-document)
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: How to convert xls document to xlsx format document |Syncfusion.
3+
description: This page explains how to convert xls document to xlsx format document using Syncfusion .NET Excel library (XlsIO).
4+
platform: file-formats
5+
control: XlsIO
6+
documentation: UG
7+
---
8+
9+
# How to convert xls document to xlsx format document?
10+
11+
The following code illustrates how to convert xls document to xlsx format document.
12+
13+
{% tabs %}
14+
{% highlight c# tabtitle="C# [Cross-platform]" %}
15+
using (ExcelEngine excelEngine = new ExcelEngine())
16+
{
17+
IApplication application = excelEngine.Excel;
18+
application.DefaultVersion = ExcelVersion.Xlsx;
19+
20+
//Loads an xls file
21+
FileStream fileStream = new FileStream("InputTemplate.xlsx", FileMode.Open, FileAccess.Read);
22+
IWorkbook workbook = application.Workbooks.Open(fileStream);
23+
24+
//Saving the workbook as stream in xlsx format
25+
FileStream stream = new FileStream("Output.xlsx", FileMode.Create, FileAccess.ReadWrite);
26+
workbook.SaveAs(stream);
27+
stream.Dispose();
28+
}
29+
{% endhighlight %}
30+
31+
{% highlight c# tabtitle="C# [Windows-specific]" %}
32+
using (ExcelEngine engine = new ExcelEngine())
33+
{
34+
IApplication application = engine.Excel;
35+
application.DefaultVersion = ExcelVersion.Xlsx;
36+
37+
//Loads an xls file
38+
IWorkbook workbook = application.Workbooks.Open("InputTemplate.xls");
39+
40+
//Saving the workbook in xlsx format
41+
workbook.SaveAs("Output.xlsx");
42+
}
43+
{% endhighlight %}
44+
45+
{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
46+
Using engine As ExcelEngine = New ExcelEngine()
47+
Dim application As IApplication = engine.Excel
48+
application.DefaultVersion = ExcelVersion.Xlsx
49+
50+
' Loads an xls file
51+
Dim workbook As IWorkbook = application.Workbooks.Open("InputTemplate.xls")
52+
53+
' Saving the workbook in xlsx format
54+
workbook.SaveAs("Output.xlsx")
55+
End Using
56+
{% endhighlight %}
57+
{% endtabs %}

0 commit comments

Comments
 (0)