Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default print macro is slow

Hi all -

My print macro below seems very slow
What can I do to make it faster?

Subprocedures used
ShowShop1 'Hides all col's except the shoppe in question
BeforePrint 'Header row color index to black, font to white/bold
AfterPrint 'Header row returned to on screen viewing format


Thanks
-goss

Print Code:
Sub PrintProcess()

Dim wb As Workbook
Dim wsMarket As Worksheet
Dim rngPrint As Range
Dim lngRows As Long

With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
.DisplayAlerts = False
End With

Set wb = ThisWorkbook
Set wsMarket = wb.Worksheets("Market")
lngRows = wsMarket.Range("A65536").End(xlUp).Row
Set rngPrint = wsMarket.Range("E2:N" & lngRows)

ShowShop1
BeforePrint


'================================================= ========================
'/Print Process
With Sheets("Market")
.PageSetup.PrintArea = rngPrint.Address
' .PageSetup.PrintArea = .Range("rngPrint").Address
End With

With wsMarket.PageSetup
.PrintTitleRows = "$1:$1"
.PrintTitleColumns = "$A:$D"
.LeftHeader = ""
.CenterHeader = "&""Arial,Bold""MyCo Market Price
Analysis"
.RightHeader = ""
.LeftFooter = "&8&D"
.CenterFooter = ""
.RightFooter = "&8&T"
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = True
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
.PrintErrors = xlPrintErrorsDisplayed
End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

'/End Print Process

'================================================= ========================

AfterPrint
wsMarket.Range("A1").Select

Set wb = Nothing
Set wsMarket = Nothing
Set rngPrint = Nothing

With Application
.ScreenUpdating = True
.Calculation = xlCalculationAutomatic
.DisplayAlerts = True
End With

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 320
Default print macro is slow

get rid of the lines you don't reall need. each one is a call to the printer
driver!
Perhaps:
With wsMarket.PageSetup
.PrintTitleRows = "$1:$1"
.PrintTitleColumns = "$A:$D"
.CenterHeader = "&""Arial,Bold""MyCo Market Price
Analysis"
.LeftFooter = "&8&D"
.RightFooter = "&8&T"
.Orientation = xlLandscape
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
End With


" wrote:

Hi all -

My print macro below seems very slow
What can I do to make it faster?

Subprocedures used
ShowShop1 'Hides all col's except the shoppe in question
BeforePrint 'Header row color index to black, font to white/bold
AfterPrint 'Header row returned to on screen viewing format


Thanks
-goss

Print Code:
Sub PrintProcess()

Dim wb As Workbook
Dim wsMarket As Worksheet
Dim rngPrint As Range
Dim lngRows As Long

With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
.DisplayAlerts = False
End With

Set wb = ThisWorkbook
Set wsMarket = wb.Worksheets("Market")
lngRows = wsMarket.Range("A65536").End(xlUp).Row
Set rngPrint = wsMarket.Range("E2:N" & lngRows)

ShowShop1
BeforePrint


'================================================= ========================
'/Print Process
With Sheets("Market")
.PageSetup.PrintArea = rngPrint.Address
' .PageSetup.PrintArea = .Range("rngPrint").Address
End With

With wsMarket.PageSetup
.PrintTitleRows = "$1:$1"
.PrintTitleColumns = "$A:$D"
.LeftHeader = ""
.CenterHeader = "&""Arial,Bold""MyCo Market Price
Analysis"
.RightHeader = ""
.LeftFooter = "&8&D"
.CenterFooter = ""
.RightFooter = "&8&T"
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = True
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
.PrintErrors = xlPrintErrorsDisplayed
End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

'/End Print Process

'================================================= ========================

AfterPrint
wsMarket.Range("A1").Select

Set wb = Nothing
Set wsMarket = Nothing
Set rngPrint = Nothing

With Application
.ScreenUpdating = True
.Calculation = xlCalculationAutomatic
.DisplayAlerts = True
End With

End Sub


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default print macro is slow

On Apr 10, 9:30 am, Bob Umlas, Excel MVP
wrote:
get rid of the lines you don't reall need. each one is a call to the printer
driver!
Perhaps:
With wsMarket.PageSetup
.PrintTitleRows = "$1:$1"
.PrintTitleColumns = "$A:$D"
.CenterHeader = "&""Arial,Bold""MyCo Market Price
Analysis"
.LeftFooter = "&8&D"
.RightFooter = "&8&T"
.Orientation = xlLandscape
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
End With



" wrote:
Hi all -


My print macro below seems very slow
What can I do to make it faster?


Subprocedures used
ShowShop1 'Hides all col's except the shoppe in question
BeforePrint 'Header row color index to black, font to white/bold
AfterPrint 'Header row returned to on screen viewing format


Thanks
-goss


Print Code:
Sub PrintProcess()


Dim wb As Workbook
Dim wsMarket As Worksheet
Dim rngPrint As Range
Dim lngRows As Long


With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
.DisplayAlerts = False
End With


Set wb = ThisWorkbook
Set wsMarket = wb.Worksheets("Market")
lngRows = wsMarket.Range("A65536").End(xlUp).Row
Set rngPrint = wsMarket.Range("E2:N" & lngRows)


ShowShop1
BeforePrint


'================================================= ========================
'/Print Process
With Sheets("Market")
.PageSetup.PrintArea = rngPrint.Address
' .PageSetup.PrintArea = .Range("rngPrint").Address
End With


With wsMarket.PageSetup
.PrintTitleRows = "$1:$1"
.PrintTitleColumns = "$A:$D"
.LeftHeader = ""
.CenterHeader = "&""Arial,Bold""MyCo Market Price
Analysis"
.RightHeader = ""
.LeftFooter = "&8&D"
.CenterFooter = ""
.RightFooter = "&8&T"
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = True
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
.PrintErrors = xlPrintErrorsDisplayed
End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True


'/End Print Process


'================================================= ========================


AfterPrint
wsMarket.Range("A1").Select


Set wb = Nothing
Set wsMarket = Nothing
Set rngPrint = Nothing


With Application
.ScreenUpdating = True
.Calculation = xlCalculationAutomatic
.DisplayAlerts = True
End With


End Sub- Hide quoted text -


- Show quoted text -


Thanks Bob -

Begs the question, I have all of that stuff configured manually
through page setup
Why do I need it in the vba code?
The only thing that will change with each report run is the print
range

Thanks
-goss

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default print macro is slow

You don't need it. Just set the printarea.

--
Regards,
Tom Ogilvy


" wrote:

On Apr 10, 9:30 am, Bob Umlas, Excel MVP
wrote:
get rid of the lines you don't reall need. each one is a call to the printer
driver!
Perhaps:
With wsMarket.PageSetup
.PrintTitleRows = "$1:$1"
.PrintTitleColumns = "$A:$D"
.CenterHeader = "&""Arial,Bold""MyCo Market Price
Analysis"
.LeftFooter = "&8&D"
.RightFooter = "&8&T"
.Orientation = xlLandscape
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
End With



" wrote:
Hi all -


My print macro below seems very slow
What can I do to make it faster?


Subprocedures used
ShowShop1 'Hides all col's except the shoppe in question
BeforePrint 'Header row color index to black, font to white/bold
AfterPrint 'Header row returned to on screen viewing format


Thanks
-goss


Print Code:
Sub PrintProcess()


Dim wb As Workbook
Dim wsMarket As Worksheet
Dim rngPrint As Range
Dim lngRows As Long


With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
.DisplayAlerts = False
End With


Set wb = ThisWorkbook
Set wsMarket = wb.Worksheets("Market")
lngRows = wsMarket.Range("A65536").End(xlUp).Row
Set rngPrint = wsMarket.Range("E2:N" & lngRows)


ShowShop1
BeforePrint


'================================================= ========================
'/Print Process
With Sheets("Market")
.PageSetup.PrintArea = rngPrint.Address
' .PageSetup.PrintArea = .Range("rngPrint").Address
End With


With wsMarket.PageSetup
.PrintTitleRows = "$1:$1"
.PrintTitleColumns = "$A:$D"
.LeftHeader = ""
.CenterHeader = "&""Arial,Bold""MyCo Market Price
Analysis"
.RightHeader = ""
.LeftFooter = "&8&D"
.CenterFooter = ""
.RightFooter = "&8&T"
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = True
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
.PrintErrors = xlPrintErrorsDisplayed
End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True


'/End Print Process


'================================================= ========================


AfterPrint
wsMarket.Range("A1").Select


Set wb = Nothing
Set wsMarket = Nothing
Set rngPrint = Nothing


With Application
.ScreenUpdating = True
.Calculation = xlCalculationAutomatic
.DisplayAlerts = True
End With


End Sub- Hide quoted text -


- Show quoted text -


Thanks Bob -

Begs the question, I have all of that stuff configured manually
through page setup
Why do I need it in the vba code?
The only thing that will change with each report run is the print
range

Thanks
-goss


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
Slow performance after print preview SV[_2_] Excel Discussion (Misc queries) 1 October 30th 09 12:24 PM
Pages going very slow to the print spooler Stormingerman Excel Discussion (Misc queries) 1 September 2nd 09 03:28 PM
Excel Slow after print setup?? cbecker Excel Discussion (Misc queries) 1 August 3rd 05 04:29 PM
Slow print preveiw Excel 2003 SP3 Gabriel van Rensburg Excel Discussion (Misc queries) 1 June 23rd 05 12:05 PM
Why does macro speed slow after Excel Print or Print Preview? Larry A[_3_] Excel Programming 6 May 16th 05 11:22 AM


All times are GMT +1. The time now is 07:23 AM.

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

About Us

"It's about Microsoft Excel"