Re: Newbie: Accessing an Excel worksheet from a Collection
Keith McAlpine <[email protected]>
| Newsgroups | gmane.comp.windows.devel.jawin |
|---|---|
| Message-ID | <LISTSERV%[email protected]> |
Steven,
Thanks for the tip. Unfortunately the Select method also gave me problems!
The Item is a *property* of the Sheets collection, so eventually I got:
mySheet = (DispatchPtr) sheets.get("Item", myWorksheetName);
to get the correct results.
The weird this is that for control objects on a worksheet (from a Shapes
collection), the invoke method on an item works fine.
Is there somewhere that clarifies the usage of the get, getObject, invoke
and getN methods? I had thought that, given a DispatchPtr object:
get() was for retrieving a property from it that was a primitive type;
getObject() was for retrieving a property from it that was another
DispatchPtr; and
invoke() was for invoking a method call on the object.
So, I have got my functionality working, but it feels more like trial and
error rather than based on some consistency.. or maybe that's Excel for
you :)
Thanks
Keith