HPageBreak not working

G

Guest

I am using Excel 2003 (ancient like me). I can insert an entry into the
HPageBreaks collection by "Insert/PageBreak" in Excel or by
ActivePage.HPageBreaks.add before:=Range("A28")
in VBA.

When I use either method, the page break is, in fact in the collection.
However when I look with Print Preview or actually print the worksheet, the
pagebreak does not take place. There is also no page marker in normal
view.

If I select the cell (or row) and click on the Insert menu, one of the
options is "Remove PageBreak" so I know the break is in the collection.

What could be causing this and how can I fix it?

Many thanks for any help.
 
C

Claus Busch

Hi,

Am Sat, 13 Oct 2012 09:28:50 -0400 schrieb (e-mail address removed):
I am using Excel 2003 (ancient like me). I can insert an entry into the
HPageBreaks collection by "Insert/PageBreak" in Excel or by
ActivePage.HPageBreaks.add before:=Range("A28")
in VBA.

try it with:
ActiveSheet.HPageBreaks.Add Range("A28")


Regards
Claus Busch
 
G

Guest

Thanks for you reply!.

Your suggestion does not work either - also - see next post with Subject:
HPageBreak not working
 
G

Guest

Thanks for you reply!.

Your suggestion does not work either - also - see next post with Subject:
HPageBreak not working
 
W

Walter Briscoe

In message <[email protected]> of Sat, 13 Oct
2012 10:41:07 in microsoft.public.excel.programming, (e-mail address removed)
writes
Thanks for you reply!.

Your suggestion does not work either - also - see next post with Subject:
HPageBreak not working

I think it unhelpful that you opened a second subject and said:
When I use any method (in Excel or in VBA) to insert an HPageBreaks, it
goes into the collection and it works, UNLESS I have the row heights set
like I want them. Then no HPageBreak works, no matter what row I put it

THAT is the bit I would like to see.
on. hen the HPageBreak is still in the collection (I can find it there)
but no PageBreak actually occurs. There is no page marker on the screen
(Either the HPageBreak or automatic breaks), Print Preview does not show
the break, and when actually printed, the break does not occur.

Thanks so much for any help.

When I insert pagebreaks, I use
ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=PlaceForPageThrow
where PlaceForPageThrow is a one cell range. I can't remember where I
found it, but have been using it for several years. I have tidied it to
ActiveSheet.HPageBreaks.Add Before:=PlaceForPageThrow
which seems to work.

I suggest you construct VBA to show the problem, starting in an empty
sheet. i.e. This works ..., but this fails. Ideas may then occur.
 

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

Top