#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 266
Default Printing Macro

I want to print a report from a macro. I recorded a macro and got this:
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.7)
.RightMargin = Application.InchesToPoints(0.7)
.TopMargin = Application.InchesToPoints(0.75)
.BottomMargin = Application.InchesToPoints(0.75)
.HeaderMargin = Application.InchesToPoints(0.3)
.FooterMargin = Application.InchesToPoints(0.3)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 50
.PrintErrors = xlPrintErrorsDisplayed
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.ScaleWithDocHeaderFooter = True
.AlignMarginsHeaderFooter = True
.EvenPage.LeftHeader.Text = ""
.EvenPage.CenterHeader.Text = ""
.EvenPage.RightHeader.Text = ""
.EvenPage.LeftFooter.Text = ""
.EvenPage.CenterFooter.Text = ""
.EvenPage.RightFooter.Text = ""
.FirstPage.LeftHeader.Text = ""
.FirstPage.CenterHeader.Text = ""
.FirstPage.RightHeader.Text = ""
.FirstPage.LeftFooter.Text = ""
.FirstPage.CenterFooter.Text = ""
.FirstPage.RightFooter.Text = ""
End With
'ActiveWindow.SelectedSheets.PrintPreview
ExecuteExcel4Macro "PRINT(1,,,1,,FALSE,,,,,,1,,,TRUE,,FALSE)"


This runs slowly - lots of screen flashing going on. I just want to print
the selection and fit to page, so I'm not sure where all the other stuff is
coming from. If I just manually select the area and print - it runs very
fast - none of the screen flashing - so I'm not sure what's going on. I
would appreciate any enlightenment on this subject. Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Printing Macro

Remove all the lines and try with the last line..

Sub MyPrint()
ExecuteExcel4Macro "PRINT(2,1,1,1,,,,,,,,1,,,TRUE,,FALSE)"
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"dhstein" wrote:

I want to print a report from a macro. I recorded a macro and got this:
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.7)
.RightMargin = Application.InchesToPoints(0.7)
.TopMargin = Application.InchesToPoints(0.75)
.BottomMargin = Application.InchesToPoints(0.75)
.HeaderMargin = Application.InchesToPoints(0.3)
.FooterMargin = Application.InchesToPoints(0.3)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 50
.PrintErrors = xlPrintErrorsDisplayed
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.ScaleWithDocHeaderFooter = True
.AlignMarginsHeaderFooter = True
.EvenPage.LeftHeader.Text = ""
.EvenPage.CenterHeader.Text = ""
.EvenPage.RightHeader.Text = ""
.EvenPage.LeftFooter.Text = ""
.EvenPage.CenterFooter.Text = ""
.EvenPage.RightFooter.Text = ""
.FirstPage.LeftHeader.Text = ""
.FirstPage.CenterHeader.Text = ""
.FirstPage.RightHeader.Text = ""
.FirstPage.LeftFooter.Text = ""
.FirstPage.CenterFooter.Text = ""
.FirstPage.RightFooter.Text = ""
End With
'ActiveWindow.SelectedSheets.PrintPreview
ExecuteExcel4Macro "PRINT(1,,,1,,FALSE,,,,,,1,,,TRUE,,FALSE)"


This runs slowly - lots of screen flashing going on. I just want to print
the selection and fit to page, so I'm not sure where all the other stuff is
coming from. If I just manually select the area and print - it runs very
fast - none of the screen flashing - so I'm not sure what's going on. I
would appreciate any enlightenment on this subject. Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 266
Default Printing Macro

Jacob,

I kept a few lines like fit to pages wide and orientation = landscape. It
seems to be faster now. Thanks.



"Jacob Skaria" wrote:

Remove all the lines and try with the last line..

Sub MyPrint()
ExecuteExcel4Macro "PRINT(2,1,1,1,,,,,,,,1,,,TRUE,,FALSE)"
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"dhstein" wrote:

I want to print a report from a macro. I recorded a macro and got this:
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.7)
.RightMargin = Application.InchesToPoints(0.7)
.TopMargin = Application.InchesToPoints(0.75)
.BottomMargin = Application.InchesToPoints(0.75)
.HeaderMargin = Application.InchesToPoints(0.3)
.FooterMargin = Application.InchesToPoints(0.3)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 50
.PrintErrors = xlPrintErrorsDisplayed
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.ScaleWithDocHeaderFooter = True
.AlignMarginsHeaderFooter = True
.EvenPage.LeftHeader.Text = ""
.EvenPage.CenterHeader.Text = ""
.EvenPage.RightHeader.Text = ""
.EvenPage.LeftFooter.Text = ""
.EvenPage.CenterFooter.Text = ""
.EvenPage.RightFooter.Text = ""
.FirstPage.LeftHeader.Text = ""
.FirstPage.CenterHeader.Text = ""
.FirstPage.RightHeader.Text = ""
.FirstPage.LeftFooter.Text = ""
.FirstPage.CenterFooter.Text = ""
.FirstPage.RightFooter.Text = ""
End With
'ActiveWindow.SelectedSheets.PrintPreview
ExecuteExcel4Macro "PRINT(1,,,1,,FALSE,,,,,,1,,,TRUE,,FALSE)"


This runs slowly - lots of screen flashing going on. I just want to print
the selection and fit to page, so I'm not sure where all the other stuff is
coming from. If I just manually select the area and print - it runs very
fast - none of the screen flashing - so I'm not sure what's going on. I
would appreciate any enlightenment on this subject. Thanks.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Printing Macro

Cheers...
--
If this post helps click Yes
---------------
Jacob Skaria


"dhstein" wrote:

Jacob,

I kept a few lines like fit to pages wide and orientation = landscape. It
seems to be faster now. Thanks.



"Jacob Skaria" wrote:

Remove all the lines and try with the last line..

Sub MyPrint()
ExecuteExcel4Macro "PRINT(2,1,1,1,,,,,,,,1,,,TRUE,,FALSE)"
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"dhstein" wrote:

I want to print a report from a macro. I recorded a macro and got this:
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.7)
.RightMargin = Application.InchesToPoints(0.7)
.TopMargin = Application.InchesToPoints(0.75)
.BottomMargin = Application.InchesToPoints(0.75)
.HeaderMargin = Application.InchesToPoints(0.3)
.FooterMargin = Application.InchesToPoints(0.3)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 50
.PrintErrors = xlPrintErrorsDisplayed
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.ScaleWithDocHeaderFooter = True
.AlignMarginsHeaderFooter = True
.EvenPage.LeftHeader.Text = ""
.EvenPage.CenterHeader.Text = ""
.EvenPage.RightHeader.Text = ""
.EvenPage.LeftFooter.Text = ""
.EvenPage.CenterFooter.Text = ""
.EvenPage.RightFooter.Text = ""
.FirstPage.LeftHeader.Text = ""
.FirstPage.CenterHeader.Text = ""
.FirstPage.RightHeader.Text = ""
.FirstPage.LeftFooter.Text = ""
.FirstPage.CenterFooter.Text = ""
.FirstPage.RightFooter.Text = ""
End With
'ActiveWindow.SelectedSheets.PrintPreview
ExecuteExcel4Macro "PRINT(1,,,1,,FALSE,,,,,,1,,,TRUE,,FALSE)"


This runs slowly - lots of screen flashing going on. I just want to print
the selection and fit to page, so I'm not sure where all the other stuff is
coming from. If I just manually select the area and print - it runs very
fast - none of the screen flashing - so I'm not sure what's going on. I
would appreciate any enlightenment on this subject. Thanks.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Printing Macro

Also you can use to disable any flashing///

Application.DisplayAlerts = False
'your code
application.DisplayAlerts = True

--
If this post helps click Yes
---------------
Jacob Skaria


"dhstein" wrote:

Jacob,

I kept a few lines like fit to pages wide and orientation = landscape. It
seems to be faster now. Thanks.



"Jacob Skaria" wrote:

Remove all the lines and try with the last line..

Sub MyPrint()
ExecuteExcel4Macro "PRINT(2,1,1,1,,,,,,,,1,,,TRUE,,FALSE)"
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"dhstein" wrote:

I want to print a report from a macro. I recorded a macro and got this:
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.7)
.RightMargin = Application.InchesToPoints(0.7)
.TopMargin = Application.InchesToPoints(0.75)
.BottomMargin = Application.InchesToPoints(0.75)
.HeaderMargin = Application.InchesToPoints(0.3)
.FooterMargin = Application.InchesToPoints(0.3)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 50
.PrintErrors = xlPrintErrorsDisplayed
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.ScaleWithDocHeaderFooter = True
.AlignMarginsHeaderFooter = True
.EvenPage.LeftHeader.Text = ""
.EvenPage.CenterHeader.Text = ""
.EvenPage.RightHeader.Text = ""
.EvenPage.LeftFooter.Text = ""
.EvenPage.CenterFooter.Text = ""
.EvenPage.RightFooter.Text = ""
.FirstPage.LeftHeader.Text = ""
.FirstPage.CenterHeader.Text = ""
.FirstPage.RightHeader.Text = ""
.FirstPage.LeftFooter.Text = ""
.FirstPage.CenterFooter.Text = ""
.FirstPage.RightFooter.Text = ""
End With
'ActiveWindow.SelectedSheets.PrintPreview
ExecuteExcel4Macro "PRINT(1,,,1,,FALSE,,,,,,1,,,TRUE,,FALSE)"


This runs slowly - lots of screen flashing going on. I just want to print
the selection and fit to page, so I'm not sure where all the other stuff is
coming from. If I just manually select the area and print - it runs very
fast - none of the screen flashing - so I'm not sure what's going on. I
would appreciate any enlightenment on this subject. Thanks.



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Printing Macro

Jacob

I believe you meant to post...............

Application.ScreenUpdating = False

your code

Application.ScreenUpdating = True


Gord Dibben MS Excel MVP

On Sun, 26 Apr 2009 05:38:01 -0700, Jacob Skaria
wrote:

Also you can use to disable any flashing///

Application.DisplayAlerts = False
'your code
application.DisplayAlerts = True


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Printing Macro

For avoiding the flashing please use...Thanks Gord...

Application.ScreenUpdating = False
'your code
Application.ScreenUpdating = True

--
If this post helps click Yes
---------------
Jacob Skaria


"dhstein" wrote:

I want to print a report from a macro. I recorded a macro and got this:
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.7)
.RightMargin = Application.InchesToPoints(0.7)
.TopMargin = Application.InchesToPoints(0.75)
.BottomMargin = Application.InchesToPoints(0.75)
.HeaderMargin = Application.InchesToPoints(0.3)
.FooterMargin = Application.InchesToPoints(0.3)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 50
.PrintErrors = xlPrintErrorsDisplayed
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.ScaleWithDocHeaderFooter = True
.AlignMarginsHeaderFooter = True
.EvenPage.LeftHeader.Text = ""
.EvenPage.CenterHeader.Text = ""
.EvenPage.RightHeader.Text = ""
.EvenPage.LeftFooter.Text = ""
.EvenPage.CenterFooter.Text = ""
.EvenPage.RightFooter.Text = ""
.FirstPage.LeftHeader.Text = ""
.FirstPage.CenterHeader.Text = ""
.FirstPage.RightHeader.Text = ""
.FirstPage.LeftFooter.Text = ""
.FirstPage.CenterFooter.Text = ""
.FirstPage.RightFooter.Text = ""
End With
'ActiveWindow.SelectedSheets.PrintPreview
ExecuteExcel4Macro "PRINT(1,,,1,,FALSE,,,,,,1,,,TRUE,,FALSE)"


This runs slowly - lots of screen flashing going on. I just want to print
the selection and fit to page, so I'm not sure where all the other stuff is
coming from. If I just manually select the area and print - it runs very
fast - none of the screen flashing - so I'm not sure what's going on. I
would appreciate any enlightenment on this subject. Thanks.

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
Macro Printing MrRJ Excel Discussion (Misc queries) 5 March 31st 09 04:41 PM
Printing Macro how do I pano Excel Worksheet Functions 1 January 23rd 07 11:41 AM
printing using a macro John Excel Discussion (Misc queries) 1 June 14th 06 01:20 PM
Macro printing Stephen C Excel Discussion (Misc queries) 3 April 18th 06 05:27 PM
Macro Printing Dave Excel Worksheet Functions 2 October 24th 05 05:56 PM


All times are GMT +1. The time now is 10:36 PM.

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"