It looks like you have run off the end of the HPageBreaks collection with
Do While i <= .HPageBreaks.Count
You should start traversing the collection from index 0 not 1 and stop before i equals the count.
Alternatively, use a for each construct e.g.
Dim pb As HPageBreak
For Each pb in objCurrentWorksheet.HPageBreaks
...