J
Jack Leach
I just got done setting up a function that recursively calls all the controls
in a commandbar and sets the visiblilty for each control.
In order to do this I had to trap an error by checking the Controls
collection of each control in the menu. The error, btw, is 438: Object does
not support this property or method.
Here's the line I check it with:
Set cbarc = cbar.Controls(1)
which correctly returns the first nested item, or error 438. No problem.
My question is this: every other array that I've used is 0 based. The
following produces error 9: Subscript out of range
Set cbarc = cbar.Controls(0)
....regardless if there's further nested controls or not.
I even put Option Base 0 in the module declarations, with the same result.
Not a big deal, but I'm just curious why this is the only collection I've
run into that is 1 based rather than 0 based. Is there some set of rules for
which collections and/or arrays are always this way, regardless of Option
Base 0?
Are Collections different from Arrays in that they will always be 1-based
rather than 0?
I thought I've used collections before by using 0, so I'm a bit perplexed...
just curious... thanks!
--
Jack Leach
www.tristatemachine.com
"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
in a commandbar and sets the visiblilty for each control.
In order to do this I had to trap an error by checking the Controls
collection of each control in the menu. The error, btw, is 438: Object does
not support this property or method.
Here's the line I check it with:
Set cbarc = cbar.Controls(1)
which correctly returns the first nested item, or error 438. No problem.
My question is this: every other array that I've used is 0 based. The
following produces error 9: Subscript out of range
Set cbarc = cbar.Controls(0)
....regardless if there's further nested controls or not.
I even put Option Base 0 in the module declarations, with the same result.
Not a big deal, but I'm just curious why this is the only collection I've
run into that is 1 based rather than 0 based. Is there some set of rules for
which collections and/or arrays are always this way, regardless of Option
Base 0?
Are Collections different from Arrays in that they will always be 1-based
rather than 0?
I thought I've used collections before by using 0, so I'm a bit perplexed...
just curious... thanks!
--
Jack Leach
www.tristatemachine.com
"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)