I have written a 6i form application that will scan an excel spreadsheet and validate the info in it against an oracle database. The application currently sets a cell in the spreadsheet on each row to indicate if the information is found or missing. What I want to do is delete the found rows so that only the rows for missing data is retained. I wrote the follwoing procedure that I am calling from the main procedure that should delete the specified row. However, the routine is skipping rows and is not deleting all the found rows. I know that the routine should work because when the cell was being set to "found", no cells were skipped. The body of the delete procedure is below. The version of excel is excel 2000. Any help would be appreciated.
PROCEDURE drop_row (row_num in number,
worksheet in ole2.obj_type) is
args ole2.obj_type;
range ole2.obj_type;
hold_range varchar2(20);
begin
hold_range := to_char(row_num)||':'||to_char(row_num);
args := ole2.create_arglist;
ole2.add_arg(args,hold_range);
range := ole2.get_obj_property(worksheet,'Range',args);
ole2.destroy_arglist(args);
ole2.invoke (RANGE, 'Delete');
ole2.release_obj (range);
end;