diff --git a/FAQ/Chart/.NET/ChartNameInWorksheet/ChartNameInWorksheet.slnx b/FAQ/Chart/.NET/ChartNameInWorksheet/ChartNameInWorksheet.slnx new file mode 100644 index 00000000..0b3a4a37 --- /dev/null +++ b/FAQ/Chart/.NET/ChartNameInWorksheet/ChartNameInWorksheet.slnx @@ -0,0 +1,3 @@ + + + diff --git a/FAQ/Chart/.NET/ChartNameInWorksheet/ChartNameInWorksheet/ChartNameInWorksheet.csproj b/FAQ/Chart/.NET/ChartNameInWorksheet/ChartNameInWorksheet/ChartNameInWorksheet.csproj new file mode 100644 index 00000000..39a86120 --- /dev/null +++ b/FAQ/Chart/.NET/ChartNameInWorksheet/ChartNameInWorksheet/ChartNameInWorksheet.csproj @@ -0,0 +1,23 @@ + + + + Exe + net10.0 + enable + enable + + + + + + + + + Always + + + Always + + + + diff --git a/FAQ/Chart/.NET/ChartNameInWorksheet/ChartNameInWorksheet/Data/Input.xlsx b/FAQ/Chart/.NET/ChartNameInWorksheet/ChartNameInWorksheet/Data/Input.xlsx new file mode 100644 index 00000000..5b24957a Binary files /dev/null and b/FAQ/Chart/.NET/ChartNameInWorksheet/ChartNameInWorksheet/Data/Input.xlsx differ diff --git a/FAQ/Chart/.NET/ChartNameInWorksheet/ChartNameInWorksheet/Output/.gitkeep b/FAQ/Chart/.NET/ChartNameInWorksheet/ChartNameInWorksheet/Output/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/FAQ/Chart/.NET/ChartNameInWorksheet/ChartNameInWorksheet/Program.cs b/FAQ/Chart/.NET/ChartNameInWorksheet/ChartNameInWorksheet/Program.cs new file mode 100644 index 00000000..5fc156e1 --- /dev/null +++ b/FAQ/Chart/.NET/ChartNameInWorksheet/ChartNameInWorksheet/Program.cs @@ -0,0 +1,26 @@ +using Syncfusion.XlsIO; + +namespace ChartNameInWorksheet +{ + class Program + { + public static void Main(string[] args) + { + using (ExcelEngine excelEngine = new ExcelEngine()) + { + IApplication application = excelEngine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; + IWorkbook workbook = application.Workbooks.Open(Path.GetFullPath(@"Data/Input.xlsx")); + IWorksheet worksheet = workbook.Worksheets[0]; + + //Get the chart name + string chartName = worksheet.Charts[0].Name; + //Display the chart name + Console.WriteLine("The name of the chart is: " + chartName); + + //Saving the workbook + workbook.SaveAs(Path.GetFullPath(@"Output/Output.xlsx")); + } + } + } +} \ No newline at end of file