View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Adding HPageBreaks after a Chart

The .chartobject has a topleftcell property and a .bottomrightcell property.

This may give you an idea:

Dim ChartObj As ChartObject
Set ChartObj = ActiveSheet.ChartObjects(1)
With ChartObj
MsgBox .TopLeftCell.Row & vbLf & .BottomRightCell.Row
End With



mathieu wrote:

Hi there,

I do not quite understand how I can add a HPageBreaks after a Chart.
HPageBreaks takes as parameter a Cell, while adding a Chart takes an
absolute position:

for ...
wc2 = ws.ChartObjects().Add(Left=left, Width=width, Top=top,
Height=height)
ws.HPageBreaks.Add(Before=ws.Cells((i+1)*20,1) )

Is there a way to Add a Chart on a particular Cell instead of an
absolute position

Thanks,


--

Dave Peterson