Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Strange behavior with old macro now throws error with "Application

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Strange behavior with old macro now throws error with "Application

Please check whether there is any issue with your printer
--
If this post helps click Yes
---------------
Jacob Skaria


"owlnevada" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Strange behavior with old macro now throws error with "Applica

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"?

"Jacob Skaria" wrote:

Please check whether there is any issue with your printer
--
If this post helps click Yes
---------------
Jacob Skaria


"owlnevada" wrote:

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

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
Request using XML HTTP object throws "Access is Denied" error Sangeeta[_2_] Excel Programming 0 February 12th 09 05:26 AM
"Strange ComboBox Behavior?" Don Excel Programming 2 August 29th 08 03:43 PM
Strange Excel Application Object Behavior Budget Programmer Excel Programming 3 August 22nd 08 05:31 PM
"Strange ComboBox Behavior?" Don[_2_] Excel Programming 0 August 22nd 08 02:43 PM
Strange macro behavior! davegb Excel Programming 9 May 20th 05 10:50 PM


All times are GMT +1. The time now is 06:34 AM.

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"