Home » Developer & Programmer » Forms » Grouping Rows in Excel using client_ole2 (Forms [32 Bit] Version 10.1.2.3.0 (Production) - Windows 7)
Grouping Rows in Excel using client_ole2 [message #612267] Tue, 15 April 2014 08:17 Go to next message
JohnHuizinga
Messages: 2
Registered: April 2014
Junior Member
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?
Re: Grouping Rows in Excel using client_ole2 [message #612289 is a reply to message #612267] Tue, 15 April 2014 11:04 Go to previous message
JohnHuizinga
Messages: 2
Registered: April 2014
Junior Member
I have it working now. In case somebody else is searching for the solution, here is my working code.

    args := Client_OLE2.CREATE_ARGLIST;
    Client_OLE2.ADD_ARG(args, 'A6:R8');
    range := CLIENT_OLE2.GET_OBJ_PROPERTY(worksheet,'Range',args) ;
    CLIENT_OLE2.DESTROY_ARGLIST(args);
    rangerow := CLIENT_OLE2.GET_OBJ_PROPERTY(range,'EntireRow');
    client_ole2.invoke(rangerow,'Group');
Previous Topic: Tracing forms in oracle forms 11g
Next Topic: How to check Opened forms in a session before switching into different responsibility
Goto Forum:
  


Current Time: Fri Apr 19 12:06:38 CDT 2024