Sub Макрос3() With ActiveSheet.PageSetup .PrintTitleRows = "" .PrintTitleColumns = "" End With ActiveSheet.PageSetup.PrintArea = "" With ActiveSheet.PageSetup .LeftHeader = "" .CenterHeader = "" .RightHeader = "" .LeftFooter = "" .CenterFooter = "" .RightFooter = "" .LeftMargin = Application.InchesToPoints(0.31496062992126) .RightMargin = Application.InchesToPoints(0.31496062992126) .TopMargin = Application.InchesToPoints(0.31496062992126) .BottomMargin = Application.InchesToPoints(0.31496062992126) .HeaderMargin = Application.InchesToPoints(0.511811023622047) .FooterMargin = Application.InchesToPoints(0.511811023622047) .PrintHeadings = False .PrintGridlines = False .PrintComments = xlPrintNoComments .PrintQuality = 600 .CenterHorizontally = False .CenterVertically = False .Orientation = xlPortrait .Draft = False .PaperSize = xlPaperA4 .FirstPageNumber = xlAutomatic .Order = xlDownThenOver .BlackAndWhite = False .Zoom = 100 .PrintErrors = xlPrintErrorsDisplayed End With End Sub
TRY oApp := CreateObject( "Excel.Application" ) CATCH ALERT( "Excel не доступен!" ) RETURN END
oAS:=oApp:ActiveSheet() oAS:PageSetup:LeftMargin := oApp:InchesToPoints(....) oAS:PageSetup:RightMargin := oApp:InchesToPoints(....) oAS:PageSetup:TopMargin := oApp:InchesToPoints(....) oAS:PageSetup:BottomMargin := oApp:InchesToPoints(....)