1
我试图创建宏在Excel 2010中Excel 2010中宏创建图表
建立图表如果我录制宏它给了我下面的代码:
ActiveSheet.Shapes.AddChart.Select
ActiveChart.SetSourceData Source:=Range("'Sheet1'!$A$1:$I$15")
ActiveChart.ChartType = xlColumnStacked
但是,当我重新运行,它给了我下面的错误:
Run time error '1004': Application defined or object defined error.
我已经尝试了许多不同的变化:
With ActiveSheet.ChartObjects.Add _
(Left:=100, Width:=690, Top:=75, Height:=375)
With .Chart
.Parent.Name = "Chart MVO"
.HasTitle = True
.ChartTitle.Text = "MVO (628) CF and DS Delivery Performance"
End With
End With
但每个给出不同的运行时间错误。我究竟做错了什么?
在这种情况下,'应用程序定义或对象定义的错误'几乎总是意味着它找不到一个对象;因此您关于确保包含数据的工作表处于活动状态的意见是点亮的。 – Stewbob 2012-07-26 12:49:16