Link to home
Start Free TrialLog in
Avatar of brothertruffle880
brothertruffle880Flag for United States of America

asked on

Excel VBA - Question about Syntax and the Language Structure

To protect and unprotect a sheet you write:
Sheet2.Protect
Sheet2.unProtect

So, how come the same rule doesn't apply to displaying page breaks?  How come you have to write:
Sheet2.displayPageBreaks = True
Sheet2.displayPageBreaks = False

The following would make more sense given the grammar of the protect/unprotect statements.
Sheet2.displayPageBreaks
Sheet2.undisplayPageBreaks

I'm trying really hard to get a philosophical grip on the grammar of VBA and it's quite a chore.  I'm looking for some threads of logic as to when I need to use "=true" or when I need to type a subscript like  worksheets ("sheet1")

OR, do I just need to bite the bullet and memorize these language conjugations.
SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of brothertruffle880

ASKER

Thank you Martin and Dephault!

You explained it PERFECTLY.  Now I'm starting to see the logic behind the language!

Thank you!
You're welcome and I'm glad I was able to help.

Marty - MVP 2009 to 2013