0
我用下面的代碼來改變Excel圖表的datalabels在C#變化DataLabels在C#中一次
using Xl = Microsoft.Office.Interop.Excel;
using officeState = Microsoft.Office.Core.MsoTriState;
....
for (int i = 0; i < rows.Count; i++)
{
series1 = (Xl.Series)xlChart.SeriesCollection(i + 1);
for (int k = 0; k < cols.Count; k++)
{
Xl.DataLabel dl = series1.DataLabels(k + 1) as Xl.DataLabel;
dl.Font.Bold = officeState.msoTrue;
dl.Font.Size = 11;
dl.Font.Name = "Times New Roman";
}
}
是否有可能同時更改所有datalabel字體? 謝謝