@jasonILHOPARK , based on my test, I find that your code is almost correct. I used my excel file and related code to get all trendline text value.
Code:
static void Main(string[] args)
{
Excel.Application appXLS = new Excel.Application();
Excel.Workbook workBook = appXLS.Workbooks.Open("D:\\test1.xlsx");
Excel.Worksheet workSheet = workBook.Worksheets[1];
Excel.ChartObjects chartObjects = workSheet.ChartObjects();
Excel.ChartObject chartObject;
Excel.Chart chart;
Excel.Trendline trendline;
Excel.DataLabel dataLabel;
Excel.Series series;
for (int i = 1; i <= chartObjects.Count; i++)
{
chartObject = workSheet.ChartObjects(i);
chart = chartObject.Chart;
series = (Excel.Series)chart.SeriesCollection(1);
trendline = series.Trendlines(1);
dataLabel = trendline.DataLabel;
Console.WriteLine(dataLabel.Text);
}
workBook.Close();
Console.ReadKey();
}
Excel file:
Result:
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.