View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Vic Eldridge[_3_] Vic Eldridge[_3_] is offline
external usenet poster
 
Posts: 112
Default Chart Objects Error

Hi Bill,

The simplest way would have to be ActiveSheet.ChartObjects.Delete

Regards,
Vic Eldridge



"Bill" wrote:

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