Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need help concerning a simpel macro that prints 2 pages out from Excel
2007. On a Vista PC it takes 45 sek, on a XP PC til takes 6 sek. Is anything the matter with my code? Sub UdskrivResultat() ' Application.ScreenUpdating = False ActiveSheet.Unprotect (****) Worksheets("Resultat").Activate With ActiveSheet.PageSetup .LeftHeader = "" .CenterHeader = "" .RightHeader = "&""Geneva""&12& BILAG" .LeftFooter = "&""Geneva""&09&F" .CenterFooter = "" .RightFooter = "&""Geneva""&09BudgetVejlby, udskrift: &D, kl. &T" .LeftMargin = Application.InchesToPoints(0.5) .RightMargin = Application.InchesToPoints(0.2) .TopMargin = Application.InchesToPoints(0.5) .BottomMargin = Application.InchesToPoints(0.8) .HeaderMargin = Application.InchesToPoints(0.2) .FooterMargin = Application.InchesToPoints(0.5) .PrintHeadings = False .PrintGridlines = False .PrintComments = xlPrintNoComments .CenterHorizontally = True .CenterVertically = False .Orientation = xlPortrait .Draft = False .PaperSize = xlPaperA4 .FirstPageNumber = xlAutomatic .Order = xlDownThenOver .BlackAndWhite = True .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = 1 .PrintErrors = xlPrintErrorsDisplayed End With Worksheets("Resultat").Range("UdRes1").Select Selection.PrintOut Copies:=1, Collate:=True Worksheets("Resultat").Range("UdRes2").Select Selection.PrintOut Copies:=1, Collate:=True Worksheets("Resultat").Range("C3").Select ActiveSheet.Protect (****) Line10: ActiveWindow.ScrollRow = 1 ActiveWindow.ScrollColumn = 1 Application.ScreenUpdating = True End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks a lot, it works and speeds things up.
Thanks a lot Claus "Don Guillett" wrote: 1. Are ANY of the page setups needed. This makes excel slow. Only use the ones desired. This may?? be all you need executed from anywhere in the workbook. with Worksheets("Resultat") .Range("UdRes1").PrintOut .Range("UdRes2").printOut end with -- Don Guillett Microsoft MVP Excel SalesAid Software "Claus Højlund" wrote in message ... I need help concerning a simpel macro that prints 2 pages out from Excel 2007. On a Vista PC it takes 45 sek, on a XP PC til takes 6 sek. Is anything the matter with my code? Sub UdskrivResultat() ' Application.ScreenUpdating = False ActiveSheet.Unprotect (****) Worksheets("Resultat").Activate With ActiveSheet.PageSetup .LeftHeader = "" .CenterHeader = "" .RightHeader = "&""Geneva""&12& BILAG" .LeftFooter = "&""Geneva""&09&F" .CenterFooter = "" .RightFooter = "&""Geneva""&09BudgetVejlby, udskrift: &D, kl. &T" .LeftMargin = Application.InchesToPoints(0.5) .RightMargin = Application.InchesToPoints(0.2) .TopMargin = Application.InchesToPoints(0.5) .BottomMargin = Application.InchesToPoints(0.8) .HeaderMargin = Application.InchesToPoints(0.2) .FooterMargin = Application.InchesToPoints(0.5) .PrintHeadings = False .PrintGridlines = False .PrintComments = xlPrintNoComments .CenterHorizontally = True .CenterVertically = False .Orientation = xlPortrait .Draft = False .PaperSize = xlPaperA4 .FirstPageNumber = xlAutomatic .Order = xlDownThenOver .BlackAndWhite = True .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = 1 .PrintErrors = xlPrintErrorsDisplayed End With Worksheets("Resultat").Range("UdRes1").Select Selection.PrintOut Copies:=1, Collate:=True Worksheets("Resultat").Range("UdRes2").Select Selection.PrintOut Copies:=1, Collate:=True Worksheets("Resultat").Range("C3").Select ActiveSheet.Protect (****) Line10: ActiveWindow.ScrollRow = 1 ActiveWindow.ScrollColumn = 1 Application.ScreenUpdating = True End Sub |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Glad to help -- Don Guillett Microsoft MVP Excel SalesAid Software "Claus Højlund" wrote in message ... Thanks a lot, it works and speeds things up. Thanks a lot Claus "Don Guillett" wrote: 1. Are ANY of the page setups needed. This makes excel slow. Only use the ones desired. This may?? be all you need executed from anywhere in the workbook. with Worksheets("Resultat") .Range("UdRes1").PrintOut .Range("UdRes2").printOut end with -- Don Guillett Microsoft MVP Excel SalesAid Software "Claus Højlund" wrote in message ... I need help concerning a simpel macro that prints 2 pages out from Excel 2007. On a Vista PC it takes 45 sek, on a XP PC til takes 6 sek. Is anything the matter with my code? Sub UdskrivResultat() ' Application.ScreenUpdating = False ActiveSheet.Unprotect (****) Worksheets("Resultat").Activate With ActiveSheet.PageSetup .LeftHeader = "" .CenterHeader = "" .RightHeader = "&""Geneva""&12& BILAG" .LeftFooter = "&""Geneva""&09&F" .CenterFooter = "" .RightFooter = "&""Geneva""&09BudgetVejlby, udskrift: &D, kl. &T" .LeftMargin = Application.InchesToPoints(0.5) .RightMargin = Application.InchesToPoints(0.2) .TopMargin = Application.InchesToPoints(0.5) .BottomMargin = Application.InchesToPoints(0.8) .HeaderMargin = Application.InchesToPoints(0.2) .FooterMargin = Application.InchesToPoints(0.5) .PrintHeadings = False .PrintGridlines = False .PrintComments = xlPrintNoComments .CenterHorizontally = True .CenterVertically = False .Orientation = xlPortrait .Draft = False .PaperSize = xlPaperA4 .FirstPageNumber = xlAutomatic .Order = xlDownThenOver .BlackAndWhite = True .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = 1 .PrintErrors = xlPrintErrorsDisplayed End With Worksheets("Resultat").Range("UdRes1").Select Selection.PrintOut Copies:=1, Collate:=True Worksheets("Resultat").Range("UdRes2").Select Selection.PrintOut Copies:=1, Collate:=True Worksheets("Resultat").Range("C3").Select ActiveSheet.Protect (****) Line10: ActiveWindow.ScrollRow = 1 ActiveWindow.ScrollColumn = 1 Application.ScreenUpdating = True End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Filtering slows down a macro | Excel Worksheet Functions | |||
macro slows down | Excel Programming | |||
Simpel commandbutton question | Excel Programming | |||
Macro slows down on subsequent runs | Excel Programming | |||
Excel macro slows down on second run | Excel Programming |