LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default HPageBreaks oddities...

Folks...

I am seeing some odd results with the behavior of the HPageBreaks
collection.

Have a look to the following code

---------------------------------------------------------------
Sub testHB()

Dim mySheet As Worksheet
Dim numItems As Integer
Dim i As Integer
Dim tmpBuf As String


Set mySheet = ActiveSheet

numItems = mySheet.HPageBreaks.Count
For i = 1 To numItems
tmpBuf = mySheet.HPageBreaks.Item(i).Location.Address
MsgBox tmpBuf
Next i

End Sub
---------------------------------------------------------------

For some reason it does fail with a "subscript out of range" error in
a not fully reproducible way (sometimes it works, sometimes it does
not) when trying to dereference item(i) with I being 1 and numItems
= 2 (i.e. when accessing HPageBreaks(2) or greater in a collection

having two or more members...

Any pointer / suggestion welcome !

Regards

--alexT
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there no one who uses PageBreaks? HPageBreaks? GeorGeorGe Excel Worksheet Functions 0 February 11th 05 05:53 PM
HPageBreaks.Add GeorGeorGe Excel Worksheet Functions 0 February 9th 05 09:31 PM
Insert HPageBreaks Robert Christie[_3_] Excel Programming 2 November 15th 03 07:01 AM
Can't set manual HPageBreaks J.E. McGimpsey Excel Programming 0 July 15th 03 03:52 PM
Can't set manual HPageBreaks J.E. McGimpsey Excel Programming 1 July 14th 03 08:12 PM


All times are GMT +1. The time now is 02:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"