ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Page breaks (https://www.excelbanter.com/excel-programming/337953-page-breaks.html)

Theresa Smallwood

Page breaks
 
I have an application that generates Excel spreadsheets. I am trying to
determine how many pagebreaks there are in the spreadsheet using the code
_wksht.HPagebreaks.Count. The problem is, this does not always seem to be
accurate. There are no vertical page breaks in my spreadsheet. There are
also no manual page breaks in the spreadsheet. In fact, I call
ResetAllPageBreaks() before getting the count.
One example has three pages (thus, 2 page breaks), but the HPagebreaks.Count
returns 1. Is there any reason for this? Is there something in my
spreadsheet I should look for so that an accurate page break count is
returned? Any help would be greatly appreciated! Thanks!

Theresa Smallwood



NickHK

Page breaks
 
Theresa,
Have you set PrintArea ?
Sure _wksht refers to the expected sheet ?

Why use a "_" as the first character of your object ?
Does that not mean "hide" to VB/VBA ?

NickHK

"Theresa Smallwood" wrote in message
...
I have an application that generates Excel spreadsheets. I am trying to
determine how many pagebreaks there are in the spreadsheet using the code
_wksht.HPagebreaks.Count. The problem is, this does not always seem to be
accurate. There are no vertical page breaks in my spreadsheet. There are
also no manual page breaks in the spreadsheet. In fact, I call
ResetAllPageBreaks() before getting the count.
One example has three pages (thus, 2 page breaks), but the

HPagebreaks.Count
returns 1. Is there any reason for this? Is there something in my
spreadsheet I should look for so that an accurate page break count is
returned? Any help would be greatly appreciated! Thanks!

Theresa Smallwood





Theresa Smallwood

Page breaks
 
Yes, I have set the print area.
The application is written in C#, so the underscore character is valid.
And yes, the _wksht does refer to the correct sheet.

Theresa

*** Sent via Developersdex http://www.developersdex.com ***


All times are GMT +1. The time now is 01:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com