View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
NateBuckley NateBuckley is offline
external usenet poster
 
Posts: 146
Default A problem with HPageBreaks

Hello is there an issue with playing with HPageBreaks, I have the following
code

Sub newPageIfRangeOver(rng as Range)

Dim pageBreaks As HPageBreaks
Dim pageBreak As HPageBreak
Set pageBreaks = Sheets(rng.Worksheet.name).HPageBreaks

For Each pageBreak In pageBreaks
...
Next pageBreak
End Sub

This Sub is called a number of times depending on data recieved, it has
started to just say "Subscript out of range" yet if I step through the the
program slowley, it works, no error. I'm just wondering if there is an error
with the HPageBreak Object that I perhaps I have overlooked.

Thanks in advance for any help thrown my way.