Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Slow performance after print preview | Excel Discussion (Misc queries) | |||
Pages going very slow to the print spooler | Excel Discussion (Misc queries) | |||
Excel Slow after print setup?? | Excel Discussion (Misc queries) | |||
Slow print preveiw Excel 2003 SP3 | Excel Discussion (Misc queries) | |||
Why does macro speed slow after Excel Print or Print Preview? | Excel Programming |