Article ID: 177108
Article Last Modified on 10/10/2006
.LeftMargin = Application.InchesToPoints() .RightMargin = Application.InchesToPoints() .TopMargin = Application.InchesToPoints() .BottomMargin = Application.InchesToPoints() .HeaderMargin = Application.InchesToPoints() .FooterMargin = Application.InchesToPoints()
.LeftMargin = Application.InchesToPoints()In order for this line of code to work correctly, there must be a value inside the parentheses. Because no value is present, you receive a compile error when you try to run the macro.
.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)Note that each set of parentheses contains a value.
.LeftMargin = Application.InchesToPoints(0.5) .RightMargin = Application.InchesToPoints() .TopMargin = Application.InchesToPoints() .BottomMargin = Application.InchesToPoints() .HeaderMargin = Application.InchesToPoints() .FooterMargin = Application.InchesToPoints()If you try to run this code, you will receive a compile error.
163435 VBA: Programming Resources for Visual Basic for Applications
Additional query words: XL97 XL98 Compile error Argument not optional XL
Keywords: kbbug kbdtacode kberrmsg kbmacro kbpending kbprogramming KB177108