Vista slows down simpel printing macro

G

Guest

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
 
D

Don Guillett

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top