Skip to content

Commit e51b5fd

Browse files
committed
Merge branch 'hotfix/hotfix-v32.1.19' of https://github.com/syncfusion-content/document-processing-docs into 1004110-ug
2 parents 9c801ed + 5a4c447 commit e51b5fd

3 files changed

Lines changed: 165 additions & 0 deletions

File tree

Document-Processing-toc.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6150,6 +6150,9 @@
61506150
<li>
61516151
<a href="/document-processing/excel/excel-library/net/faqs/how-to-resolve-the-cannot-open-Pivot-table-source-file-error">How to resolve the cannot open pivot table source file error?</a>
61526152
</li>
6153+
<li>
6154+
<a href="/document-processing/excel/excel-library/net/faqs/how-to-retrieve-the-list-of-named-ranges-in-an-Excel-workbook">How to retrieve the list of named ranges in an Excel workbook?</a>
6155+
</li>
61536156
<li>
61546157
<a href="/document-processing/excel/excel-library/net/faqs/how-to-extract-embedded-OLE-files-from-an-Excel-workbook-as-streams">How to extract embedded OLE files from an Excel workbook as streams?</a>
61556158
</li>
@@ -6195,6 +6198,9 @@
61956198
<li>
61966199
<a href="/document-processing/excel/excel-library/net/faqs/does-xlsio-support-changing-the-colors-of-built-in-icon-sets">Does XlsIO support changing the colors of built-in icon sets?</a>
61976200
</li>
6201+
<li>
6202+
<a href="/document-processing/excel/excel-library/net/faqs/how-to-retrieve-the-name-of-the-chart-in-an-Excel-worksheet">How to retrieve the name of the chart in an Excel worksheet?</a>
6203+
</li>
61986204
</ul>
61996205
</li>
62006206
</ul>
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
title: Retrieve the list of named ranges in an Excel workbook | Syncfusion
3+
description: Code example to retrieve the list of named ranges in an Excel workbook using Syncfusion .NET Excel library (XlsIO).
4+
platform: document-processing
5+
control: XlsIO
6+
documentation: UG
7+
---
8+
9+
# How to retrieve the list of named ranges in an Excel workbook?
10+
11+
The following code examples demonstrate retrieving the list of named ranges in an Excel workbook using C# (Cross-platform and Windows-specific) and VB.NET.
12+
13+
{% tabs %}
14+
{% highlight c# tabtitle="C# [Cross-platform]" playgroundButtonLink="https://raw.githubusercontent.com/SyncfusionExamples/XlsIO-Examples/master/FAQ/Named%20Range/.NET/RetrieveNamedRanges/RetrieveNamedRanges/Program.cs,180" %}
15+
using (ExcelEngine excelEngine = new ExcelEngine())
16+
{
17+
IApplication application = excelEngine.Excel;
18+
application.DefaultVersion = ExcelVersion.Xlsx;
19+
IWorkbook workbook = application.Workbooks.Open(Path.GetFullPath(@"Data/Input.xlsx"));
20+
IWorksheet worksheet = workbook.Worksheets[0];
21+
22+
//Retrieving names defined in the workbook
23+
IName[] names = new IName[workbook.Names.Count];
24+
for (int i = 0; i < workbook.Names.Count; i++)
25+
{
26+
names[i] = workbook.Names[i];
27+
Console.WriteLine(names[i].Name);
28+
}
29+
30+
//Saving the workbook
31+
workbook.SaveAs(Path.GetFullPath(@"Output/Output.xlsx"));
32+
}
33+
{% endhighlight %}
34+
35+
{% highlight c# tabtitle="C# [Windows-specific]" %}
36+
using (ExcelEngine excelEngine = new ExcelEngine())
37+
{
38+
IApplication application = excelEngine.Excel;
39+
application.DefaultVersion = ExcelVersion.Xlsx;
40+
IWorkbook workbook = application.Workbooks.Open("Input.xlsx");
41+
IWorksheet worksheet = workbook.Worksheets[0];
42+
43+
//Retrieving names defined in the workbook
44+
IName[] names = new IName[workbook.Names.Count];
45+
for (int i = 0; i < workbook.Names.Count; i++)
46+
{
47+
names[i] = workbook.Names[i];
48+
Console.WriteLine(names[i].Name);
49+
}
50+
51+
//Saving the workbook
52+
workbook.SaveAs("Output.xlsx");
53+
}
54+
{% endhighlight %}
55+
56+
{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
57+
Using excelEngine As New ExcelEngine()
58+
' Instantiate the Excel application object
59+
Dim application As IApplication = excelEngine.Excel
60+
61+
' Set the default application version
62+
application.DefaultVersion = ExcelVersion.Xlsx
63+
64+
' Load the existing Excel workbook into IWorkbook
65+
Dim workbook As IWorkbook = application.Workbooks.Open("Input.xlsx")
66+
67+
' Get the first worksheet in the workbook into IWorksheet
68+
Dim worksheet As IWorksheet = workbook.Worksheets(0)
69+
70+
' Retrieving names defined in the workbook
71+
Dim names(workbook.Names.Count - 1) As IName
72+
For i As Integer = 0 To workbook.Names.Count - 1
73+
names(i) = workbook.Names(i)
74+
Console.WriteLine(names(i).Name)
75+
Next
76+
77+
' Saving the workbook
78+
workbook.SaveAs("Output.xlsx")
79+
End Using
80+
{% endhighlight %}
81+
{% endtabs %}
82+
83+
A complete working example in C# is present on <a href="https://github.com/SyncfusionExamples/XlsIO-Examples/tree/master/FAQ/Named%20Range/.NET/RetrieveNamedRanges">this GitHub page</a>.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
title: Retrieve the name of the chart in an Excel worksheet | Syncfusion
3+
description: Code example to retrieve the name of the chart in an Excel worksheet using Syncfusion .NET Excel library (XlsIO).
4+
platform: document-processing
5+
control: XlsIO
6+
documentation: UG
7+
---
8+
9+
# How to retrieve the name of the chart in an Excel worksheet?
10+
11+
The following code examples demonstrate retrieving the name of the chart in an Excel worksheet using C# (Cross-platform and Windows-specific) and VB.NET.
12+
13+
{% tabs %}
14+
{% highlight c# tabtitle="C# [Cross-platform]" playgroundButtonLink="https://raw.githubusercontent.com/SyncfusionExamples/XlsIO-Examples/master/FAQ/Chart/.NET/ChartNameInWorksheet/ChartNameInWorksheet/Program.cs,180" %}
15+
using (ExcelEngine excelEngine = new ExcelEngine())
16+
{
17+
IApplication application = excelEngine.Excel;
18+
application.DefaultVersion = ExcelVersion.Xlsx;
19+
IWorkbook workbook = application.Workbooks.Open(Path.GetFullPath(@"Data/Input.xlsx"));
20+
IWorksheet worksheet = workbook.Worksheets[0];
21+
22+
//Get the chart name
23+
string chartName = worksheet.Charts[0].Name;
24+
//Display the chart name
25+
Console.WriteLine("The name of the chart is: " + chartName);
26+
27+
//Saving the workbook
28+
workbook.SaveAs(Path.GetFullPath(@"Output/Output.xlsx"));
29+
}
30+
{% endhighlight %}
31+
32+
{% highlight c# tabtitle="C# [Windows-specific]" %}
33+
using (ExcelEngine excelEngine = new ExcelEngine())
34+
{
35+
IApplication application = excelEngine.Excel;
36+
application.DefaultVersion = ExcelVersion.Xlsx;
37+
IWorkbook workbook = application.Workbooks.Open("Input.xlsx");
38+
IWorksheet worksheet = workbook.Worksheets[0];
39+
40+
//Get the chart name
41+
string chartName = worksheet.Charts[0].Name;
42+
//Display the chart name
43+
Console.WriteLine("The name of the chart is: " + chartName);
44+
45+
//Saving the workbook
46+
workbook.SaveAs("Output.xlsx");
47+
}
48+
{% endhighlight %}
49+
50+
{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
51+
Using excelEngine As New ExcelEngine()
52+
' Access the IApplication instance
53+
Dim application As IApplication = excelEngine.Excel
54+
55+
' Set the default version
56+
application.DefaultVersion = ExcelVersion.Xlsx
57+
58+
' Open the input workbook
59+
Dim workbook As IWorkbook = application.Workbooks.Open("InputTemplate.xlsx")
60+
61+
' Get the first worksheet
62+
Dim worksheet As IWorksheet = workbook.Worksheets(0)
63+
64+
' Get the chart name
65+
Dim chartName As String = worksheet.Charts(0).Name
66+
67+
' Display the chart name
68+
Console.WriteLine("The name of the chart is: " & chartName)
69+
70+
' Save the workbook to output
71+
workbook.SaveAs("Output.xlsx")
72+
End Using
73+
{% endhighlight %}
74+
{% endtabs %}
75+
76+
A complete working example in C# is present on <a href="https://github.com/SyncfusionExamples/XlsIO-Examples/tree/master/FAQ/Chart/.NET/ChartNameInWorksheet">this GitHub page</a>.

0 commit comments

Comments
 (0)