Excel doesn't know what you mean by NewChart. Change NewChart to
OnTimeStatus or vice versa, and try again.
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
jmdaniel wrote:
Keeping running into "Run Time Error 424 Object Required" error on the following code, line 4:
Sub Chart()
Dim OnTimeStatus As Chart
Set OnTimeStatus = ThisWorkbook.Charts.Add()
NewChart.Name = "On Time Status"
NewChart.ChartType = x1PieExploded
NewChart.SetSourceData Source:=Worksheets("NI Supplier Delivery Performan").Range("P1:P300")
End Sub
And how would I get the chart to show up in the actual file the data is in, instead of showing up in the file the macro is in? I assume I replace ThisWorkbook above with the name of the file, but that didn't work, perhaps because of this other issue.
Thanks.