View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bill[_30_] Bill[_30_] is offline
external usenet poster
 
Posts: 89
Default Chart Objects Error

Hello,
I have two or more chart objects on worksheet that I want to delete before I
rebuild them. I am using the following code to do that:

Nchobj = ActiveSheet.ChartObjects.Count
For i = 1 To Nchobj
ActiveSheet.ChartObjects(i).Delete
Next i
Exit For

The first one deletes OK. The second chart object generates this message:

Unable to get ChartObjects property of the Worksheet class. On debug, it
goes to the activesheet.chartobjects(i).delete line.

Any ideas? Thanks.

Bill