Page breaks

T

Theresa Smallwood

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
 
N

NickHK

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
 
T

Theresa Smallwood

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 ***
 

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