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: 14
Default Deleting HPageBreaks returns...

Hi,

I have just read a quite lengthy conversation on the subject of
removing horizonal and vertical page breaks. Unfortunately, the person
who was hoping to find a solution to the problem here did not find it
then. Maybe today she knows how to achieve the result she wanted to.
The problem is the following. I want to programatically remove all (or
some) horizontal page breaks on a sheet. One suggestion that I've found
here is to type in this piece of code and set in motion:

Sub DeleteHPageBreaks()

Dim pb As HPageBreak
Dim lCount As Long

For lCount = ActiveSheet.HPageBreaks.Count To 1 Step -1
Set pb = ActiveSheet.HPageBreaks(lCount)
If pb.Type = xlPageBreakManual Then pb.Delete
Next lCount

End Sub

Regrettably, it produces an error (1004) which does not say much about
what's really happened. Actually, says nothing at all. I have also
tried a For Next...Loop version of the above with the same result. Is
this a real bug? Could anybody, please, give me an answer?

Darlove (PL)

 
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
More HpageBreaks Strangeness BillzyBop Excel Programming 0 June 23rd 04 03:40 AM
HPageBreaks oddities... Alex T Excel Programming 3 June 8th 04 02:01 PM
Can't set manual HPageBreaks J.E. McGimpsey Excel Programming 0 July 15th 03 03:52 PM


All times are GMT +1. The time now is 11:48 PM.

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"