Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks! That worked!
"SeanC UK" wrote: Hi Daniel, I've had a look at this and the only time I seem to get the error is when the view is Normal. In Page Break Preview the code works whether stepping through the code using F8 or running it through a macro. Try something like this to force the Page Break Preview view: Sub PBreakSub() Dim intWinView As Integer intWinView = ActiveWindow.View ActiveWindow.View = xlPageBreakPreview ActiveSheet.VPageBreaks(1).DragOff Direction:=xlToRight, _ regionindex:=1 ActiveWindow.View = intWinView End Sub I have done this with screen updating on and off and it works. If you are still having troubles with this then please give more code so that we can duplicate your process more accurately. I hope this helps. Sean. "Daniel Bonallack" wrote: I have a line in my code that adjusts the page so that there is no vertical page break ActiveSheet.VPageBreaks(1).DragOff Direction:=xlToRight, RegionIndex:=1 This line works fine if you F8 through the code, but if you run the macro, it returns an error (err.number = 1004, Application-defined or object defined error) Any help appreciated! Daniel |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
strange error | Excel Discussion (Misc queries) | |||
strange error | Excel Worksheet Functions | |||
Strange error | Setting up and Configuration of Excel | |||
Very strange error | Excel Discussion (Misc queries) | |||
Strange error | Excel Programming |