View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
F*SH[_2_] F*SH[_2_] is offline
external usenet poster
 
Posts: 1
Default Putting pagebreaks after objects


Hi again

I've got a page that has lots of charts on it, stacked above each other
vertically. When I want to print the page, Excel has a habit of cutting
the occasional unlucky graph in half :D

So, to help stop this needless charticide, I want to add some page
breaks. Specifically, one after every 8 charts. This I thought would be
easy when I saw the HPageBreaks property. Great, I thought, after every
8th chart I'll just add one of these with

Code:
--------------------

ActiveSheet.HPageBreaks.Add After:=ActiveChart

--------------------


Naturally, it wasn't so cooperative, and gave me big, unrecoverable
errors. Any idea why? Presumably it's because it wants a cell, rather
than an object, as a location reference. Which suggests another way -
is there any way to determine the row onwhich the chart's lower edge
can be found? Then I could add a pagebreak to a cell on this row, which
will probably be more agreeable to VB.

Thanks.


--
F*SH
------------------------------------------------------------------------
F*SH's Profile: http://www.excelforum.com/member.php...o&userid=36355
View this thread: http://www.excelforum.com/showthread...hreadid=561958