Adding HPageBreaks after a Chart

M

mathieu

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,
 
D

Dave Peterson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top