+ Reply to Thread
Results 1 to 6 of 6

Issue with VBA error code < VPageBreaks(1).DragOff >

  1. #1
    Registered User
    Join Date
    04-26-2013
    Location
    Argentina
    MS-Off Ver
    Excel 2010
    Posts
    37

    Question Issue with VBA error code < VPageBreaks(1).DragOff >

    Hi All,

    I have a problem when i tried to run a macro with the following sentence "ActiveSheet.VPageBreaks(1).DragOff". Attached is the excel file that i'm using; do you know if something is missing?

    I want to setup a print area from "B11" to "G74" or there is another way to set a print area with a macro for multiple sheets?

    Part of the code
    PHP Code: 
    With ActiveSheet.PageSetup
                                
    .PrintTitleRows ""
                                
    .PrintTitleColumns ""
                            
    End With
                            ActiveSheet
    .PageSetup.PrintArea "$B$11:$G$74"
                            
    With ActiveSheet.PageSetup
                                
    .LeftHeader ""
                                
    .CenterHeader ""
                                
    .RightHeader ""
                                
    .LeftFooter ""
                                
    .CenterFooter ""
                                
    .RightFooter ""
                                
    .LeftMargin Application.InchesToPoints(0)
                                .
    RightMargin Application.InchesToPoints(0)
                                .
    TopMargin Application.InchesToPoints(0.47)
                                .
    BottomMargin Application.InchesToPoints(0)
                                .
    HeaderMargin Application.InchesToPoints(0)
                                .
    FooterMargin Application.InchesToPoints(0)
                                .
    PrintHeadings False
                                
    .PrintGridlines False
                                
    .PrintComments xlPrintNoComments
                                
    .PrintQuality = -4
                                
    .CenterHorizontally False
                                
    .CenterVertically False
                                
    .Orientation xlPortrait
                                
    .Draft False
                                
    .PaperSize xlPaperA4
                                
    .FirstPageNumber xlAutomatic
                                
    .Order xlDownThenOver
                                
    .BlackAndWhite False
                                
    .Zoom 100
                                
                                
    'ActiveSheet.VPageBreaks(1).DragOff Direction:=xlToRight, RegionIndex:=1
                                                      
                            End With 
    https://dl.dropboxusercontent.com/u/85562478/Recibo.xls

    Hope you know the answer.

    Thanks,
    Last edited by martinpaiva; 03-17-2014 at 12:28 PM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Issue with VBA error code < VPageBreaks(1).DragOff >

    There is no vertical page break. So you don't need that line.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    04-26-2013
    Location
    Argentina
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: Issue with VBA error code < VPageBreaks(1).DragOff >

    So, as you told me i don't need that line...
    PHP Code: 
     ActiveSheet.VPageBreaks(1).DragOff Direction:=xlToRightRegionIndex:=
    but the problem that i have, is when i run the macro and the tried to print ... the print area is from B11 to F70.

    I don't have a knowledge about VBA so this is difficult to me.

    Thank you for your help on this! And excuse me for my english

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Issue with VBA error code < VPageBreaks(1).DragOff >

    Try this...

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-26-2013
    Location
    Argentina
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: Issue with VBA error code < VPageBreaks(1).DragOff >

    Thanks, I tried, but I got the same "error". I don't know why i cant setup the print area/margins to B11 to F70. It's like the page margins are disposed to "B11:F70"

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Issue with VBA error code < VPageBreaks(1).DragOff >

    As a test, set the .Zoom = 50 just to see if it all fits on one page. That should print everything at 1/2 size

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Issue with ActiveSheet.VPageBreaks(1).DragOff
    By martinpaiva in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-04-2014, 06:07 AM
  2. SharePoint code issue - error 52 ---
    By Inez15 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-16-2013, 08:34 PM
  3. VPageBreaks works but it falls over at HPageBreaks
    By JimmyA in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-09-2012, 09:52 AM
  4. Run time Error 9 - Specific Code Issue
    By dreicer_Jarr in forum Excel General
    Replies: 5
    Last Post: 03-02-2010, 02:21 PM
  5. VPageBreaks macro
    By .paul. in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-26-2009, 02:43 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1