ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Vista slows down simpel printing macro (https://www.excelbanter.com/excel-programming/397055-vista-slows-down-simpel-printing-macro.html)

Claus Højlund[_2_]

Vista slows down simpel printing macro
 
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

Don Guillett

Vista slows down simpel printing macro
 
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



Claus Højlund[_2_]

Vista slows down simpel printing macro
 
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




Don Guillett

Vista slows down simpel printing macro
 

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






All times are GMT +1. The time now is 07:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com