Palmetto, thanks for taking a look at this situation.
After much Goggling and experimentation I have discovered that if the sheet is put into layout view before HPageBreaks.count the result is correct.
May have something to do with the print sheet page setup being landscape orientation.
Code:
ActiveWindow.View = xlPageLayoutView
numpages = Sheets("Master").HPageBreaks.Count + 1
ActiveWindow.View = xlNormalView
This works in my Excel 2010, but Excel 2003 can't deal with xlPageLayoutView and gives a compiler error of "variable not defined".
If I comment out the xlLayoutView line Excel 2003 has no issues.
It's kind of looking like I'll be putting the above code in it's own procedure, check for the version of Excel being used, and only call it for 2010 (and 2007 ???) having Excel 2003 and older avoid xlPageLayoutView altogether.
Thanks again
NoS
Bookmarks