I have a worksheet that spans multiple pages, both vertically and horizontally. It has certain rows and columns that are set to repeat on each page. I would like to know where these page breaks are going to be; I essentially want to get the information from Page Break Preview into my C# code so that I can fix things like cells that are merged across pages, and adding a signature box that is one page wide.
I tried using the Worksheet.HPageBreaks property, but the HPageBreaks.Count property is always null, even when I know that the worksheet has multiple pages.
To the best of my own knowledge, Excel does not store that data internally, but rather calculates it closer to real time based on PageSettings, PrinterSettings, manually stored “PageBreak” markers, and cell sizes and content.
The best solution I could suggest would be attempting to calculate these things yourself.
I also freely admit that I could be completely wrong about this, but from my own experiences, this is likely the case. I will update as//if//when my own research finds something new.
Update: Link
This is barely relevant, but on the same topic. Perhaps it contains some examples or data that you can manipulate for your own ends.
http://social.msdn.microsoft.com/Forums/sv/exceldev/thread/0d1fd9f2-9111-42c4-ad36-3082f4311202