Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All, i have a proceedure that sets up the printer in VBA, but it is
very slow, i know this is a problem but is there any way to speed it up ? Les Stout *** Sent via Developersdex http://www.developersdex.com *** |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Don't set commands you don't need to change.
Also, using the excel4 macro version is usually faster. See this past post by John Green: --------------------------------------------------------------- From: John Green ) Subject: About PageSetup.. Newsgroups: microsoft.public.excel.programming View complete thread (10 articles) Date: 2001-01-22 12:57:23 PST PageSetup in VBA has always been a painfully slow process. If you can't avoid having to set these parameters, you can use the Excel 4 macro function, PAGE.SETUP to carry out most of the PageSetup operations much more quickly. The following two macros are almost equivalent, and should give you the clues you need to start using PAGE.SETUP. You can download a full description of all the Excel 4 macro functions from Microsoft's web site: Sub PS() ActiveSheet.DisplayPageBreaks = False With ActiveSheet.PageSetup .LeftHeader = "My Company" .CenterHeader = "" .RightHeader = "&D / &T" .LeftFooter = "Highly Confidential and Proprietary" .CenterFooter = "" .RightFooter = "Finance" .LeftMargin = Application.InchesToPoints(0.54) .RightMargin = Application.InchesToPoints(0.3) .TopMargin = Application.InchesToPoints(0.4) .BottomMargin = Application.InchesToPoints(0.36) .HeaderMargin = Application.InchesToPoints(0.22) .FooterMargin = Application.InchesToPoints(0.17) .PrintHeadings = False .PrintGridlines = False .PrintComments = xlPrintNoComments ' .PrintQuality = 600 ' does not work with all the printers .CenterHorizontally = True .CenterVertically = True .Orientation = xlLandscape .Draft = False .PaperSize = xlPaperLetter .FirstPageNumber = xlAutomatic .Order = xlDownThenOver .BlackAndWhite = False .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = 1 End With End Sub Sub PS4() head = """&LMy Company&R&D / &T""" foot = """&LHighly Confidential and Proprietary&RFinance""" pLeft = 0.54 pRight = 0.3 Top = 0.4 bot = 0.36 head_margin = 0.22 foot_margin = 0.17 hdng = False grid = False notes = False quality = "" h_cntr = False v_cntr = False orient = 2 Draft = False paper_size = 1 pg_num = """Auto""" pg_order = 1 bw_cells = False pscale = True pSetUp = "PAGE.SETUP(" & head & "," & foot & "," & pLeft & "," & pRight & "," pSetUp = pSetUp & Top & "," & bot & "," & hdng & "," & grid & "," & h_cntr & "," pSetUp = pSetUp & v_cntr & "," & orient & "," & paper_size & "," & pscale & "," pSetUp = pSetUp & pg_num & "," & pg_order & "," & bw_cells & "," & quality & "," pSetUp = pSetUp & head_margin & "," & foot_margin & "," & notes & "," & Draft & ")" Application.ExecuteExcel4Macro pSetUp End Sub John Green (Excel MVP) Sydney Australia -- Regards, Tom Ogilvy "Les Stout" wrote in message ... Hi All, i have a proceedure that sets up the printer in VBA, but it is very slow, i know this is a problem but is there any way to speed it up ? Les Stout *** Sent via Developersdex http://www.developersdex.com *** |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Tom, i did try this it worked great actually but did not know how to
set the sheet to Landscape in the code it indicates a number "1" but still prints portrait and doesn't change no matter what number i put in, i also need it to print on 1 page wide but many long ? Do you have any suggestions ? best regards, Les Stout *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Print and Print Preview Graphic Moving Resizing 2007/2003 | Excel Discussion (Misc queries) | |||
cell borders that I create dont show on print preview or print | Excel Discussion (Misc queries) | |||
Pivot Table macro to set print area and print details of drill down data | Excel Discussion (Misc queries) | |||
Active cell counting in particular print page (one sheet having different print area) | Excel Worksheet Functions | |||
Need Help w/ Print Macro to Print All Visible Sheets (including Charts) in a Workbook | Excel Programming |