Rachel Chia
Rachel Chia

Reputation: 259

Chart object delete error

I am doing the clear function. Whenever there is no Chart Object to delete, it pop out an error. Is there a way to make it error free? When it does not have a chart to clear, it just leave it the same as it is.

Sheet6.ChartObjects.Delete

Upvotes: 2

Views: 169

Answers (1)

Subodh Tiwari sktneer
Subodh Tiwari sktneer

Reputation: 9976

One way is this...

On Error Resume Next
Sheet6.ChartObjects.Delete
On Error GoTo 0

Upvotes: 1

Related Questions