Avatar of brothertruffle880
brothertruffle880
Flag 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.
Microsoft ExcelVisual Basic.NET

Avatar of undefined
Last Comment
Martin Liss

8/22/2022 - Mon
SOLUTION
Martin Liss

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
Dephault

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
brothertruffle880

ASKER
Thank you Martin and Dephault!

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

Thank you!
Martin Liss

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

Marty - MVP 2009 to 2013
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes