before print event not working

G

goss

Hi all

Appears my b4 print event is not working.
When I print I receive no right header or center footer
I tried commenting out the .rh and .cf out of the print routine
Received same results

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Worksheets("Main").Activate
With ActiveSheet.PageSetup
.RightHeader = ActiveSheet.Range("C1").Value
.CenterFooter = ActiveSheet.Range("C2").Value
End With
End Sub

Print Routine:
Sub Print_Main()

Application.ScreenUpdating = False
Worksheets("Main").Select
Range("B4:J47").Select
ActiveSheet.PageSetup.PrintArea = "$B$4:$J$47"
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
.LeftHeader = ""
.CenterHeader = ""
.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 = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = True
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
.PrintErrors = xlPrintErrorsDisplayed
End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Range("D7").Select
Application.ScreenUpdating = True
End Su
 
D

Don Guillett

A very cursory look suggests that perhaps you dont have a period before each
item in your with
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top