标签: excel vba excel-vba
我有一个代码可以将活动图表类型更改为其他图形类型,如条形图,列等。当我从vba开发人员模式运行它时,但是当我创建一个按钮并将此宏指定给它时,此代码有效。它给了我object variable not set error。为什么会发生这种情况?对此有何解决方案?这是我的代码。非常感谢!
object variable not set error
Sub MarkerLineChart() With ActiveChart.Parent ActiveChart.ChartType = xlLineMarkers End With End Sub