View Single Post
 
Old 02-15-2017, 11:26 AM
aramaglia aramaglia is offline Windows 7 64bit Office 2016
Novice
 
Join Date: Jan 2017
Posts: 8
aramaglia is on a distinguished road
Talking "Number must be between 100 and 400" error when printing

Hello,

I have this script that works great, and it prints out a sheet just like it is supposed to. However sometimes there is an error that pops up stating that "The number must be between 10 and 400". It was harmless as everything worked, but now I am trying to expand the script to print multiple pages, and I do not want the user to have to clear this error when it pops up. I have had no luck finding any helpful solutions so far, and I am wondering if anyone else has had this issue?

For reference,

Code:
Application.PrintCommunication = False
    With ws8.PageSetup
        .PrintArea = "$A$1:$K$" & CommLR + 22 - 1 & ""
        .LeftHeader = ""
        .CenterHeader = "&""Arial,bold""&28" & Header
        .RightHeader = ""
        .LeftFooter = ""
        .CenterFooter = ""
        .RightFooter = ""
        .LeftMargin = Application.InchesToPoints(0.39)
        .RightMargin = Application.InchesToPoints(0.39)
        .TopMargin = Application.InchesToPoints(0.5)
        .BottomMargin = Application.InchesToPoints(0.5)
        .HeaderMargin = Application.InchesToPoints(0)
        .FooterMargin = Application.InchesToPoints(0)
        .PrintHeadings = False
        .PrintGridlines = False
        .PrintComments = xlPrintSheetEnd
        .PrintQuality = 600
        .CenterHorizontally = True
        .CenterVertically = True
        .Orientation = xlLandscape
        .Draft = False
        .PaperSize = xlPaperLetter
        .FirstPageNumber = xlAutomatic
        .Order = xlDownThenOver
        .BlackAndWhite = False
        .Zoom = 58
    End With

    ws8.Range("A1:P" & CommLR + 22 - 1).PrintOut
Reply With Quote