C
Claus Højlund
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
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