Can't Delete Page Breaks????

xdollbabyx

New Member
Joined
Apr 11, 2007
Messages
7
I have an Excel 2007 file that should be around 8 pages long. When I go into Page break mode it is broken in 72 pages. I have inserted NO page breaks. I have used reset all page breaks, that has not helped. It will not allowe me to manually adjust or delete these breaks. When I view the document in Print Preview it shows a modified version of page 1 on all 72 pages and no other information.

I have never seen this before..... HELP??
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
What happens if you follow these steps:

Press Alt+F11 (careful, that's ALT+F11)

Press Ctrl+G

Type in or paste in
Code:
Cells.PageBreak = xlPageBreakNone
and hit the Enter key



Then...

Type in or paste in
Code:
ActiveSheet.DisplayAutomaticPageBreaks = False
and hit the Enter key.

Then...

Press Alt+Q to return to the worksheet.

Any joy?
 
Upvote 0
What happens if you follow these steps:

Press Alt+F11 (careful, that's ALT+F11)

Press Ctrl+G

Type in or paste in
Code:
Cells.PageBreak = xlPageBreakNone
and hit the Enter key



Then...

Type in or paste in
Code:
ActiveSheet.DisplayAutomaticPageBreaks = False
and hit the Enter key.

Then...

Press Alt+Q to return to the worksheet.

Any joy?

Thank you so much for your response. When I enter in the first code I get an error:

Runtime error 1004
Unable to Set the Page Break Property of the Range Class.

Does that make any sense?

I continued with the rest of the steps but it did not help. Other thoughts??
 
Upvote 0
Well, something weird is going on either with your spreadsheet or you did not enter the statement precisely as I posted it. It works without a problem on my 2010 system and it will work in 2007 or 2003. Are you sure you had a cell in the worksheet selected, as opposed to maybe being on a chart sheet at the time...just thinking out loud because the code line will not error when executed as described.
 
Upvote 0
Well, something weird is going on either with your spreadsheet or you did not enter the statement precisely as I posted it. It works without a problem on my 2010 system and it will work in 2007 or 2003. Are you sure you had a cell in the worksheet selected, as opposed to maybe being on a chart sheet at the time...just thinking out loud because the code line will not error when executed as described.

I tried again, I made sure I selected a single cell (C7 not that it matters) and still got the error. I copied and pasted the statement.

Cells.PageBreak = xlPageBreakNone


I took a screen shot but forgot I can't post it here. Still erroring. :( Sometimes I want to kick my computer!
 
Upvote 0
I cannot duplicate your error. PageBreak is a property of the Cells class.

Positive you're entering this in the Immediate Window, where you hit Ctrl+G first, after getting into the VBE with Alt+F11?

Is the workbook protected? Is it read only? Any tiny demons with horns and pitchforks lurking on top of the computer? Something else is happening with your workbook.
 
Upvote 0
I cannot duplicate your error. PageBreak is a property of the Cells class.

Positive you're entering this in the Immediate Window, where you hit Ctrl+G first, after getting into the VBE with Alt+F11?

Is the workbook protected? Is it read only? Any tiny demons with horns and pitchforks lurking on top of the computer? Something else is happening with your workbook.

I am not suprised you can't duplicate, I have never seen anything like this, so I am just baffled.

I am positive, I followed the steps step by step 3 times before responding.

The WB is not protected, it is not read only. It worked just fine in 2003 and printed. They just upgraded me to 2007 2 days ago and now I am having this issue. Could it be something with the conversion from 2003 to 2007?? I don't know why that would be but I also can't find the demon hiding on my computer. I found a couple dust bunnies, I think I will name them Fred and Barney.

Maybe I just need to try copy and pasting into a new workbook and starting over? that just seems like a waste.
 
Upvote 0
Maybe it's because the attempt at a fix is being made on a file that was created in 2003 but now operates in 2007. See if it changes anything if you save the file as a macro-enabled workbook (with the extension .xlsm), and then set your macro security settings to allow VBA. To do that, click the round Office button near the top left corner of the window, then click Options > Customize Ribbon > click to select Developer and click OK.

Now, click the Developer tab on the ribbon.

Near the far left click Macro security.

Click the macro settings button.

For now, select the option "Enable all macros...not recommended yada yada" and click OK.

Try closing the file, close Excel, reopen Excel, reopen the file, and following those codeline entry steps again.

This is a lot more work than a human should have to do, but sometimes when an upgrade of Office systems is done, and an old version file is being run in a newer version, some one-time housekeeping is needed.

Might still not work, but if not, sorry, I cannot guess what's wrong.
 
Upvote 0
Maybe it's because the attempt at a fix is being made on a file that was created in 2003 but now operates in 2007. See if it changes anything if you save the file as a macro-enabled workbook (with the extension .xlsm), and then set your macro security settings to allow VBA. To do that, click the round Office button near the top left corner of the window, then click Options > Customize Ribbon > click to select Developer and click OK.

Now, click the Developer tab on the ribbon.

Near the far left click Macro security.

Click the macro settings button.

For now, select the option "Enable all macros...not recommended yada yada" and click OK.

Try closing the file, close Excel, reopen Excel, reopen the file, and following those codeline entry steps again.

This is a lot more work than a human should have to do, but sometimes when an upgrade of Office systems is done, and an old version file is being run in a newer version, some one-time housekeeping is needed.

Might still not work, but if not, sorry, I cannot guess what's wrong.


Tom ~~ Thank you so much for all your time, energy and thought on this. I still got the Unable to set Page Break error. It is quite likely our IT department has disabled something, or installed incorrectly, or caused some other modification that is resulting in this error. (I normally don't like to blame other departments, but my experience with our IT lately resulted in a call back that ended with, "Well shoot I guess Google was wrong, I will do more searching and call you back." I lost a little faith)

I have copied and pasted the first worksheet into a new workbook and it seems to be working just fine, so I will just continue to do so and hope I remember all the linked documents to update appropriately.

Thanks again!! Treat yourself to a drink on me. ;)
 
Upvote 0
Thanks a lot for the follow-up. Me? Drinking on a college football weekend? Well, absolutely. I'm looking forward to another fun October weekend.
 
Upvote 0

Forum statistics

Threads
1,214,661
Messages
6,120,796
Members
448,994
Latest member
rohitsomani

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top