Greetings, all:
I am in the midst of teaching some C# and I do not have Excel in front of
me, but a student posed a question about how to refer to a given worksheet
inside a workbook.
Can I say something like this?
exlApp.Workbooks(0).Worksheets(0)...
to refer to the first worksheet of the first workbook?
Can someone verify the syntax?
Are these collections0-based or 1-based?

Signature
Peace & happy computing,
Mike Labosh, MCSD MCT
Owner, vbSensei.Com
"Escriba coda ergo sum." -- vbSensei
Jim Rech - 27 Apr 2007 14:52 GMT
Both collections are 1 based. The workbook indexing apparently depends on
the order opened so it would be pretty unreliable. You should use the
workbook's name Workbooks("abc.xls") or ActiveWorkbook.
I almost always use Worksheets("Sheetname"), if I know the name, in
preference to an index. Within a project though I'd first use the sheet's
VB Codename since it does not change with sheet order or name. That is not
easy to use outside of the project though.

Signature
Jim
> Greetings, all:
>
[quoted text clipped - 11 lines]
>
> Are these collections0-based or 1-based?