如何使用VBA更改Excel图表中的数据标签宽度?

我想通过VBA代码更改Excel图表中的标签宽度:

set lbl = SERIES1. points(1).datalabel msgbox lbl.width 'this is working lbl.width = 40 ' compile error: wrong number of arguments or invalid property assignment 

我可以得到标签的宽度,但不能改变它。 我究竟做错了什么?

AFAIK,图表数据点标签的宽度不可configuration。 即使可以使用VBA检索宽度,也无法使用VBA命令或属性来设置或更改宽度。

根据文档,DataLabels.Width属性是只读的。

Returns the width, in points, of the object. Read-only. 资源

Excel图表标签仍顽固不合作,并抵制格式化的尝试,无论是VBA或用户界面。

这是(不幸),Excel如何工作。

不要拍摄使者。

如果你想有所作为,可以考虑在excel.uservoice.com提出一个想法