T
The Fold
Hi,
I've recently setup a new PC to run some company reports. This is a
process I've done numerous times in the past, but for some reason,
when I press the macro shortcut (Ctrl+R) to run any report, it gets as
far as the page layout macro and then comes back with an error like
Runtime error 1004
Unable to set PrintTitleRows property of the PageSetup class
and it does this for every row of code that uses that class.
Here's a sample of code:
With ActiveSheet.PageSetup
.PrintTitleRows = "$1:$1"
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.LeftHeader = "&""Arial,Bold""Handheld Concession Sales"
.CenterHeader = ""
.RightHeader = "&""Arial,Bold""&D"
.LeftFooter = "&""Arial,Bold""&9&F / &A"
.CenterFooter = ""
.RightFooter = "&""Arial,Bold""&9&P of &N"
.LeftMargin = Application.InchesToPoints(0.748031496062992)
.RightMargin = Application.InchesToPoints(0.748031496062992)
.TopMargin = Application.InchesToPoints(0.984251968503937)
.BottomMargin = Application.InchesToPoints(0.984251968503937)
.HeaderMargin = Application.InchesToPoints(0.511811023622047)
.FooterMargin = Application.InchesToPoints(0.511811023622047)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
End With
Range("A1").Select
Any ideas? I'm pretty desperate as I need these reports to run this
weekend.
Thanks
I've recently setup a new PC to run some company reports. This is a
process I've done numerous times in the past, but for some reason,
when I press the macro shortcut (Ctrl+R) to run any report, it gets as
far as the page layout macro and then comes back with an error like
Runtime error 1004
Unable to set PrintTitleRows property of the PageSetup class
and it does this for every row of code that uses that class.
Here's a sample of code:
With ActiveSheet.PageSetup
.PrintTitleRows = "$1:$1"
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.LeftHeader = "&""Arial,Bold""Handheld Concession Sales"
.CenterHeader = ""
.RightHeader = "&""Arial,Bold""&D"
.LeftFooter = "&""Arial,Bold""&9&F / &A"
.CenterFooter = ""
.RightFooter = "&""Arial,Bold""&9&P of &N"
.LeftMargin = Application.InchesToPoints(0.748031496062992)
.RightMargin = Application.InchesToPoints(0.748031496062992)
.TopMargin = Application.InchesToPoints(0.984251968503937)
.BottomMargin = Application.InchesToPoints(0.984251968503937)
.HeaderMargin = Application.InchesToPoints(0.511811023622047)
.FooterMargin = Application.InchesToPoints(0.511811023622047)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
End With
Range("A1").Select
Any ideas? I'm pretty desperate as I need these reports to run this
weekend.
Thanks