nikki333
04-01-2019, 01:53 PM
Hi Folks
I'm trying to write code to put manual page breaks on a report. The report contains several blocks of rows that I don't want to break across pages.
So, I check if the automatic page break falls in the middle of one of these blocks, and set a manual break before that block. This works fine while the report has only 1 pagebreak.
However, in case of more than 2 pages, I'd like to find the automatic page break for the second page and so forth, after I set the line number of the page break of the previous page.
For example:
i get the number of pages like so: numSeitenzahl = ExecuteExcel4Macro("Get.Document(50)")
and then get the line number for the automatic break like so: numZeileUmbruch = .HPageBreaks.Item(i).Location.Row
As said, this works for the first break, but then I need a way to tell excel that the first break has been changed and that it should look for a reasonable 2nd break. Any ideas?
I'm trying to write code to put manual page breaks on a report. The report contains several blocks of rows that I don't want to break across pages.
So, I check if the automatic page break falls in the middle of one of these blocks, and set a manual break before that block. This works fine while the report has only 1 pagebreak.
However, in case of more than 2 pages, I'd like to find the automatic page break for the second page and so forth, after I set the line number of the page break of the previous page.
For example:
i get the number of pages like so: numSeitenzahl = ExecuteExcel4Macro("Get.Document(50)")
and then get the line number for the automatic break like so: numZeileUmbruch = .HPageBreaks.Item(i).Location.Row
As said, this works for the first break, but then I need a way to tell excel that the first break has been changed and that it should look for a reasonable 2nd break. Any ideas?