Strange behavior with old macro now throws error with "Application

O

owlnevada

I've been using this same macro for years and all of a sudden after moving
some code around between modules, this code changed the appearance of the
word "Application" to "application" and throws error "Expected function or
variable". I removed all the Option Explicit's and no change.

Anybody have a clue as to what would cause this behavior?


Sub FixAbsPageSetupDefaultsNew() '(Optional control As IRibbonControl)
'ResetAbstractPrintArea
'
' ResetAbstractPrintArea Macro
' Clears Print Area then fixes all printer defaults to our standard
templates settings
'

Dim I As Integer
Dim Count As Integer
Dim sheetnames() As String
Dim ws As Worksheet

Count = 1

Call SelectAllAbstracts ' makes these selected sheets in the activeworkbook

application.ScreenUpdating = False 'here and also down below

For Each ws In ActiveWindow.SelectedSheets

With ws.PageSetup
.PrintArea = ""
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = "&""Arial,Regular""&8&F &A"
.CenterFooter = "&""Arial,Regular""&8Printed on &D" '
.RightFooter = ""
.LeftMargin = application.InchesToPoints(0.5)
.RightMargin = application.InchesToPoints(0.5)
.TopMargin = application.InchesToPoints(0.25)
.BottomMargin = application.InchesToPoints(0)
.HeaderMargin = application.InchesToPoints(0)
.FooterMargin = application.InchesToPoints(0)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = True
.CenterVertically = True
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With

Next ws
ActiveWindow.Zoom = 70
ActiveWindow.DisplayGridlines = False

Range("N2").Select

End Sub
 
O

owlnevada

No problems with printing as far as I know. Even if there was, could that
cause the text to change from upper to lower case in the word "Application"?
 

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