Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default problem with finding horizontal page breaks

Hi

I'm trying to use the following code to get all the horizontal page
breaks

Dim varArray() As Variant
Dim x As Variant
Dim i As Integer

For Each x In objWkBk.Worksheets("sheet1").HPageBreaks
i = i + 1
ReDim Preserve varArray(i)
varArray(i) = x.Location.Row
Next x

objWkBk is in separate instance of excel.
The problem is if there is more than 1 page break the code errors with
a subscript out of range. Any ideas?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default problem with finding horizontal page breaks

Try it in PageBreakPreview... ActiveWindow.View = xlPageBreakPreview
You may also have to put a temporary value in an empty cell below your data.
Then remove the temp value when you are done.
--
Jim Cone
Portland, Oregon USA
http://www.mediafire.com/PrimitiveSoftware
(Special Print XL add-in: long columns printed side by side)




"Keith Willis"
wrote in message
...
Hi

I'm trying to use the following code to get all the horizontal page
breaks

Dim varArray() As Variant
Dim x As Variant
Dim i As Integer

For Each x In objWkBk.Worksheets("sheet1").HPageBreaks
i = i + 1
ReDim Preserve varArray(i)
varArray(i) = x.Location.Row
Next x

objWkBk is in separate instance of excel.
The problem is if there is more than 1 page break the code errors with
a subscript out of range. Any ideas?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default problem with finding horizontal page breaks

Thanks for reply but same error msg

On Nov 3, 2:39*pm, "Jim Cone" wrote:
Try it in PageBreakPreview... ActiveWindow.View = xlPageBreakPreview
You may also have to put a temporary value in an empty cell below your data.
Then remove the temp value when you are done.
--
Jim Cone
Portland, Oregon USAhttp://www.mediafire.com/PrimitiveSoftware
(Special Print XL add-in: *long columns printed side by side)

"Keith Willis"
wrote in ...







Hi


I'm trying to use the following code to get all the horizontal page
breaks


Dim varArray() As Variant
Dim x As Variant
Dim i As Integer


* *For Each x In objWkBk.Worksheets("sheet1").HPageBreaks
* * * *i = i + 1
* * * *ReDim Preserve varArray(i)
* * * *varArray(i) = x.Location.Row
* *Next x


objWkBk is in separate instance of excel.
The problem is if there is more than 1 page break the code errors with
a subscript out of range. Any ideas?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default problem with finding horizontal page breaks


N = objWkBk.Worksheets("Sheet1").HPageBreaks.Count
For X = 1 to N
varArray(X) = objWkBk.Worksheets("Sheet1").HPageBreaks(X).Locati on.Row
'other stuff needed
Next
'---
Might be a problem if the Application is not visible.
My original comments still apply.
--
Jim Cone
Portland, Oregon USA
http://www.mediafire.com/PrimitiveSoftware
(Data Rows Excel add-in: Color rows, Delete rows, Insert rows)




"Keith Willis"

wrote in message
...
Thanks for reply but same error msg

On Nov 3, 2:39 pm, "Jim Cone" wrote:
Try it in PageBreakPreview... ActiveWindow.View = xlPageBreakPreview
You may also have to put a temporary value in an empty cell below your data.
Then remove the temp value when you are done.
--
Jim Cone
Portland, Oregon USA
http://www.mediafire.com/PrimitiveSoftware
(Special Print XL add-in: long columns printed side by side)







"Keith Willis"
wrote in messagenews:
...
Hi


I'm trying to use the following code to get all the horizontal page
breaks


Dim varArray() As Variant
Dim x As Variant
Dim i As Integer


For Each x In objWkBk.Worksheets("sheet1").HPageBreaks
i = i + 1
ReDim Preserve varArray(i)
varArray(i) = x.Location.Row
Next x


objWkBk is in separate instance of excel.
The problem is if there is more than 1 page break the code errors with
a subscript out of range. Any ideas?



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default problem with finding horizontal page breaks

Tried that still the same problem.

though i've noticed that when i try to open a watch on the new
worksheet to check the pagebreaks i get the msg "system policy prevent
loading of manifests" wonder if it might be related.


On Nov 3, 7:10*pm, "Jim Cone" wrote:
N = objWkBk.Worksheets("Sheet1").HPageBreaks.Count
For X = 1 to N
* *varArray(X) = objWkBk.Worksheets("Sheet1").HPageBreaks(X).Locati on.Row
* 'other stuff needed
Next
'---
Might be a problem if the Application is not visible.
My original comments still apply.
--
Jim Cone
Portland, Oregon USAhttp://www.mediafire.com/PrimitiveSoftware
(Data Rows Excel add-in: Color rows, Delete rows, Insert rows)

"Keith Willis"

wrote in ...
Thanks for reply but same error msg

On Nov 3, 2:39 pm, "Jim Cone" wrote:







Try it in PageBreakPreview... ActiveWindow.View = xlPageBreakPreview
You may also have to put a temporary value in an empty cell below your data.
Then remove the temp value when you are done.
--
Jim Cone
Portland, Oregon USA
http://www.mediafire.com/PrimitiveSoftware
(Special Print XL add-in: long columns printed side by side)
"Keith Willis"
wrote in messagenews:
...
Hi


I'm trying to use the following code to get all the horizontal page
breaks


Dim varArray() As Variant
Dim x As Variant
Dim i As Integer


For Each x In objWkBk.Worksheets("sheet1").HPageBreaks
i = i + 1
ReDim Preserve varArray(i)
varArray(i) = x.Location.Row
Next x


objWkBk is in separate instance of excel.
The problem is if there is more than 1 page break the code errors with
a subscript out of range. Any ideas?




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default problem with finding horizontal page breaks

Curiously if i scroll through the worksheet maually to the pagebreak
that fails as i'm stepping through the code the code runs fine

On Nov 4, 1:48*pm, Keith Willis wrote:
Tried that still the same problem.

though i've noticed that when i try to open a watch on the new
worksheet to check the pagebreaks i get the msg "system policy prevent
loading of manifests" wonder if it might be related.

On Nov 3, 7:10*pm, "Jim Cone" wrote:







N = objWkBk.Worksheets("Sheet1").HPageBreaks.Count
For X = 1 to N
* *varArray(X) = objWkBk.Worksheets("Sheet1").HPageBreaks(X).Locati on.Row
* 'other stuff needed
Next
'---
Might be a problem if the Application is not visible.
My original comments still apply.
--
Jim Cone
Portland, Oregon USAhttp://www.mediafire.com/PrimitiveSoftware
(Data Rows Excel add-in: Color rows, Delete rows, Insert rows)


"Keith Willis"

wrote in ...
Thanks for reply but same error msg


On Nov 3, 2:39 pm, "Jim Cone" wrote:


Try it in PageBreakPreview... ActiveWindow.View = xlPageBreakPreview
You may also have to put a temporary value in an empty cell below your data.
Then remove the temp value when you are done.
--
Jim Cone
Portland, Oregon USA
http://www.mediafire.com/PrimitiveSoftware
(Special Print XL add-in: long columns printed side by side)
"Keith Willis"
wrote in messagenews:
...
Hi


I'm trying to use the following code to get all the horizontal page
breaks


Dim varArray() As Variant
Dim x As Variant
Dim i As Integer


For Each x In objWkBk.Worksheets("sheet1").HPageBreaks
i = i + 1
ReDim Preserve varArray(i)
varArray(i) = x.Location.Row
Next x


objWkBk is in separate instance of excel.
The problem is if there is more than 1 page break the code errors with
a subscript out of range. Any ideas?


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default problem with finding horizontal page breaks

That's beyond my skill level. Suggest you do a web search and/or contact your system administrator.
'--
Jim Cone


"Keith Willis"
wrote in message
...
Tried that still the same problem.

though i've noticed that when i try to open a watch on the new
worksheet to check the pagebreaks i get the msg "system policy prevent
loading of manifests" wonder if it might be related.





On Nov 3, 7:10 pm, "Jim Cone" wrote:
N = objWkBk.Worksheets("Sheet1").HPageBreaks.Count
For X = 1 to N
varArray(X) = objWkBk.Worksheets("Sheet1").HPageBreaks(X).Locati on.Row
'other stuff needed
Next
'---
Might be a problem if the Application is not visible.
My original comments still apply.
--
Jim Cone
Portland, Oregon USAhttp://www.mediafire.com/PrimitiveSoftware
(Data Rows Excel add-in: Color rows, Delete rows, Insert rows)

"Keith Willis"

wrote in ...
Thanks for reply but same error msg

On Nov 3, 2:39 pm, "Jim Cone" wrote:







Try it in PageBreakPreview... ActiveWindow.View = xlPageBreakPreview
You may also have to put a temporary value in an empty cell below your data.
Then remove the temp value when you are done.
--
Jim Cone
Portland, Oregon USA
http://www.mediafire.com/PrimitiveSoftware
(Special Print XL add-in: long columns printed side by side)
"Keith Willis"
wrote in messagenews:
...
Hi


I'm trying to use the following code to get all the horizontal page
breaks


Dim varArray() As Variant
Dim x As Variant
Dim i As Integer


For Each x In objWkBk.Worksheets("sheet1").HPageBreaks
i = i + 1
ReDim Preserve varArray(i)
varArray(i) = x.Location.Row
Next x


objWkBk is in separate instance of excel.
The problem is if there is more than 1 page break the code errors with
a subscript out of range. Any ideas?



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default problem with finding horizontal page breaks

Something a bit odd. Using your code if i scroll on the workbook the
the row with the pagebreak the code runs, but i have to do this for
each pagebreak.


On Nov 4, 1:48*pm, Keith Willis wrote:
Tried that still the same problem.

though i've noticed that when i try to open a watch on the new
worksheet to check the pagebreaks i get the msg "system policy prevent
loading of manifests" wonder if it might be related.

On Nov 3, 7:10*pm, "Jim Cone" wrote:







N = objWkBk.Worksheets("Sheet1").HPageBreaks.Count
For X = 1 to N
* *varArray(X) = objWkBk.Worksheets("Sheet1").HPageBreaks(X).Locati on.Row
* 'other stuff needed
Next
'---
Might be a problem if the Application is not visible.
My original comments still apply.
--
Jim Cone
Portland, Oregon USAhttp://www.mediafire.com/PrimitiveSoftware
(Data Rows Excel add-in: Color rows, Delete rows, Insert rows)


"Keith Willis"

wrote in ...
Thanks for reply but same error msg


On Nov 3, 2:39 pm, "Jim Cone" wrote:


Try it in PageBreakPreview... ActiveWindow.View = xlPageBreakPreview
You may also have to put a temporary value in an empty cell below your data.
Then remove the temp value when you are done.
--
Jim Cone
Portland, Oregon USA
http://www.mediafire.com/PrimitiveSoftware
(Special Print XL add-in: long columns printed side by side)
"Keith Willis"
wrote in messagenews:
...
Hi


I'm trying to use the following code to get all the horizontal page
breaks


Dim varArray() As Variant
Dim x As Variant
Dim i As Integer


For Each x In objWkBk.Worksheets("sheet1").HPageBreaks
i = i + 1
ReDim Preserve varArray(i)
varArray(i) = x.Location.Row
Next x


objWkBk is in separate instance of excel.
The problem is if there is more than 1 page break the code errors with
a subscript out of range. Any ideas?


Reply
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
1026 horizontal page breaks? GregL Excel Discussion (Misc queries) 0 April 30th 08 07:03 PM
Trying to delete existing unwanted horizontal page breaks John Strickland Excel Programming 1 January 30th 08 12:04 AM
Horizontal Page Breaks Jon Peltier Excel Programming 0 December 5th 06 06:54 PM
horizontal page breaks Santhosh Kumar Excel Discussion (Misc queries) 1 June 25th 05 02:04 PM
Count the number of just the horizontal manual page breaks DataFreakFromUtah Excel Programming 1 November 27th 03 03:59 PM


All times are GMT +1. The time now is 01:03 PM.

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

About Us

"It's about Microsoft Excel"