执行.SeriesCollection(5).DataLabels(1).Format.TextFrame2.TextRange.Text = some_value
使用以下代码:
Dim chart As Excel.Chart
chart = xlWorkBook.ActiveChart
chart.ChartType = Excel.XlChartType.xlBarStacked
With chart
... some code ...
.SeriesCollection(5).DataLabels(1).Format.TextFrame2.TextRange.Text = some_value
.... some code ....
End chart
错误消息是
Microsoft.VisualBasic.dll中发生了'System.Runtime.InteropServices.COMException类型的未处理异常 附加信息:无法获取DataLabels类的Count属性。'
谢谢。