Skip to content

Commit 26dcb2e

Browse files
author
GowthamPonrajSF5414
committed
1009870- add FileExtension FAQ
1 parent 4ffe10e commit 26dcb2e

2 files changed

Lines changed: 55 additions & 0 deletions

File tree

Document-Processing-toc.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6424,6 +6424,9 @@
64246424
<li>
64256425
<a href="/document-processing/excel/excel-library/net/faqs/how-to-get-the-maximum-supported-rows-and-columns-in-an-excel-worksheet">How to get the maximum rows and columns in a worksheet using XlsIO?</a>
64266426
</li>
6427+
<li>
6428+
<a href="/document-processing/excel/excel-library/net/faqs/how-to-get-the-file-extension-of-excel-file">How to get the file extension of an Excel file using XlsIO?</a>
6429+
</li>
64276430
</ul>
64286431
</li>
64296432
</ul>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
title: How to get file extension of an Excel file | XlsIO | Syncfusion
3+
description: This page explains how to get the file extension of an Excel file using the Syncfusion .NET Excel library (XlsIO).
4+
platform: document-processing
5+
control: XlsIO
6+
documentation: UG
7+
---
8+
9+
# How to get the file extension of an Excel file using XlsIO?
10+
11+
When an Excel file is opened with XlsIO, you can obtain its full path and extension from the [WorkbookImpl.FullFileName](https://help.syncfusion.com/cr/document-processing/Syncfusion.XlsIO.Implementation.WorkbookImpl.html#Syncfusion_XlsIO_Implementation_WorkbookImpl_FullFileName) property. The following code snippet illustrates this.
12+
13+
{% tabs %}
14+
{% highlight c# tabtitle="C# [Cross-platform]" %}
15+
using (ExcelEngine excelEngine = new ExcelEngine())
16+
{
17+
IApplication application = excelEngine.Excel;
18+
IWorkbook workbook = application.Workbooks.Open("Sample.xlsx");
19+
20+
string fileName = (workbook as WorkbookImpl).FullFileName;
21+
22+
// Display file extension of excel file
23+
Console.WriteLine(Path.GetExtension(fileName));
24+
}
25+
{% endhighlight %}
26+
27+
{% highlight c# tabtitle="C# [Windows-specific]" %}
28+
using (ExcelEngine excelEngine = new ExcelEngine())
29+
{
30+
IApplication application = excelEngine.Excel;
31+
IWorkbook workbook = application.Workbooks.Open("Sample.xlsx");
32+
33+
string fileName = (workbook as WorkbookImpl).FullFileName;
34+
35+
// Display file extension of excel file
36+
Console.WriteLine(Path.GetExtension(fileName));
37+
}
38+
{% endhighlight %}
39+
40+
{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
41+
Using excelEngine As New ExcelEngine()
42+
Dim application As IApplication = excelEngine.Excel
43+
Dim workbook As IWorkbook = application.Workbooks.Open("Sample.xlsx")
44+
45+
Dim fileName As String = CType(workbook, WorkbookImpl).FullFileName
46+
47+
' Display file extension of excel file
48+
Console.WriteLine(Path.GetExtension(fileName))
49+
End Using
50+
{% endhighlight %}
51+
{% endtabs %}
52+

0 commit comments

Comments
 (0)