Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default 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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Filtering slows down a macro Curt D. Excel Worksheet Functions 1 October 13th 06 04:08 AM
macro slows down Gary Keramidas Excel Programming 1 January 21st 06 11:35 PM
Simpel commandbutton question Andy T via OfficeKB.com Excel Programming 3 September 8th 05 06:39 PM
Macro slows down on subsequent runs RWN Excel Programming 0 August 25th 05 01:47 AM
Excel macro slows down on second run lee777 Excel Programming 2 June 17th 04 02:28 PM


All times are GMT +1. The time now is 02:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"