I have been unable to figure out how to group rows using client_ole2. An exhaustive Google search only gave me one chunk of example code. This is what I've tried:
args := Client_OLE2.CREATE_ARGLIST;
Client_OLE2.ADD_ARG(args, 'A6:R8'); --Just an example. I use variables for the row numbers.
range := CLIENT_OLE2.GET_OBJ_PROPERTY(worksheet,'Range',args) ;
CLIENT_OLE2.DESTROY_ARGLIST(args);
client_ole2.invoke ( Range, 'Select' ); --I added this line to see if it would help. It didn't.
client_ole2.invoke(range,'Group');
I get the error:
WUO-707 [OleFunctions.invoke_obj()] Unable to invoke Method: Group; Exception
com.jacob.com.ComFailException: Invoke of: Group
Source: Microsoft Office Excel
Description: Unable to get the Group property of the Range class
...which may be informative to someone but it just tells me it didn't work.
I saw a post somewhere that suggested that if you can record it in a macro you can figure out a way to do it in client_ole2 (well that might not have been exactly what was said but I'm an optimist). In the spirit of that, here is what I want to do in VBA syntax.
Range("A6:R8").Select
Selection.Rows.Group
Can anybody suggest a solution for me?