This discussion is archived
4 Replies Latest reply: Jan 10, 2013 6:55 AM by Askdineshsingh RSS

Webutil Error

user2974660 Newbie
Currently Being Moderated
Hi all,

I get the following error when i tried the data into excel format,

WUO-709 [OleFunctions.get_obj_property_args()] Unable to get Property: open; Exception
com.jacob.com.ComFailException: Invoke of: open
Source: Microsoft Office Excel
Description: 'E:\JPMorgan\EXTRACTION\07012013_Finance Upload Template.xlsx' could not be found. Check the spelling of the file name, and verify that the file location is correct.

If you are trying to open the file from your list of most recently used files, make sure that the file has not been renamed, moved, or deleted

The path mentioned in the description is available,Kindly help me in this regard

Code


PACKAGE BODY PKG_EXCEL IS
procedure create_excel is
begin
     --close_excel;
     PKG_EXCEL.application := CLIENT_OLE2.CREATE_OBJ('Excel.Application');
     CLIENT_OLE2.SET_PROPERTY(PKG_eXCEL.application, 'Visible', 'false');
     PKG_EXCEL.workbooks := CLIENT_OLE2.GET_OBJ_PROPERTY(PKG_EXCEL.application, 'workbooks');
     PKG_EXCEL.workbook := CLIENT_OLE2.GET_OBJ_PROPERTY(PKG_EXCEL.workbooks, 'Add');
     PKG_EXCEL.worksheets := CLIENT_OLE2.GET_OBJ_PROPERTY(PKG_EXCEL.workbook, 'worksheets');
     PKG_EXCEL.worksheet := CLIENT_OLE2.GET_OBJ_PROPERTY(PKG_EXCEL.worksheets, 'Add');
EXCEPTION
     WHEN OTHERS THEN
          PROC_EXECLOG(:SYSTEM.CURRENT_FORM||'.PKG_EXCEL.CREATE_EXCEL, error:'||sqlerrm);
end;



PROCEDURE OPEN_EXCEL(P_FILE IN VARCHAR2, P_SHEET IN VARCHAR2) IS
     /*application CLIENT_OLE2.obj_type;
     workbooks      CLIENT_OLE2.obj_type;
     workbook           CLIENT_OLE2.obj_type;
     worksheets      CLIENT_OLE2.obj_type;
     worksheet      CLIENT_OLE2.list_type;
     args CLIENT_OLE2.list_type;*/
     l_ind varchar(10);
BEGIN
     l_ind := '1.1';
     --PROC_EXECLOG(:SYSTEM.CURRENT_FORM||',PKG_EXCEL.OPEN_EXCEL, P_FILE:'||P_FILE||', P_SHEET:'||P_SHEET);
     APPLICATION := CLIENT_OLE2.CREATE_OBJ('Excel.Application');
     l_ind := '1.1.1';
     CLIENT_OLE2.SET_PROPERTY(application, 'Visible', 'false');
     args                     := CLIENT_OLE2.create_arglist;
     l_ind := '1.1.2';
     CLIENT_OLE2.add_arg(args,P_FILE);

     L_IND := '1.2';
     workbooks      := CLIENT_OLE2.GET_OBJ_PROPERTY(APPLICATION, 'Workbooks');
     workbook           := CLIENT_OLE2.GET_OBJ_PROPERTY(Workbooks,'open',args);
     CLIENT_OLE2.destroy_arglist(args);

     
     L_IND := '1.3';
     worksheets      := CLIENT_OLE2.GET_OBJ_PROPERTY(workbook, 'Worksheets');
     args := CLIENT_OLE2.create_arglist;
     --CLIENT_OLE2.add_arg(args,'Sheet1');
     
     --PROC_EXECLOG(:SYSTEM.CURRENT_FORM||',PKG_EXCEL.OPEN_EXCEL, p_sheet:'||p_sheet||';');
     IF P_SHEET IS NOT NULL THEN
          CLIENT_OLE2.add_arg(args,P_SHEET);
          --CLIENT_OLE2.add_arg(args,'Sheet1');
     ELSE
          CLIENT_OLE2.add_arg(args,'Sheet1');
     END IF;

     L_IND := '1.4';
     worksheet      := CLIENT_OLE2.GET_OBJ_PROPERTY(Worksheets,'item',args);
     CLIENT_OLE2.destroy_arglist(args);
EXCEPTION
     WHEN OTHERS THEN
          PROC_EXECLOG(:SYSTEM.CURRENT_FORM||',PKG_EXCEL.OPEN_EXCEL, Error:'||sqlerrm||', ind:'||l_ind);
END;
     procedure put_excel_Value (p_row number, p_cel number, p_value in varchar2, P_LAST IN VARCHAR2, P_BOLD IN VARCHAR2) is
     
          arg CLIENT_OLE2.obj_type;
          cell CLIENT_OLE2.obj_type;
          myfont CLIENT_OLE2.obj_type;
     begin
          args := CLIENT_OLE2.CREATE_ARGLIST;
          CLIENT_OLE2.ADD_ARG(args, p_row);
          CLIENT_OLE2.ADD_ARG(args, p_cel);
          
          /*CLIENT_OLE2.ADD_ARG(args, PKG_EXCEL.G_COL);
          IF P_LAST ='L' THEN
               PKG_EXCEL.G_COL := 1;
          ELSE
               PKG_EXCEL.G_COL := PKG_EXCEL.G_COL + 1;
          END IF;*/
          CELL := CLIENT_OLE2.GET_OBJ_PROPERTY(worksheet, 'Cells', args);
          CLIENT_OLE2.DESTROY_ARGLIST(args);
          CLIENT_OLE2.set_property(CELL, 'Value', p_value);
          
          IF NVL(P_BOLD,'N')='0' /*and p_cel=1*/ THEN
               myfont := CLIENT_OLE2.GET_OBJ_PROPERTY(CELL, 'FONT');
               CLIENT_OLE2.set_property(myfont, 'Bold',1);
               CLIENT_OLE2.set_property(myfont, 'ColorIndex',5);
               CLIENT_OLE2.RELEASE_OBJ(myfont);
               myfont := client_ole2.get_obj_property(cell, 'Interior'); --background
               client_ole2.set_property(myfont, 'ColorIndex', 48); --background color Number
               CLIENT_OLE2.RELEASE_OBJ(myfont);
          END IF;
          CLIENT_OLE2.RELEASE_OBJ(CELL);
     exception
               when others then
                    PROC_EXECLOG(:SYSTEM.CURRENT_FORM||'.PKG_EXCEL.put_excel_Value, error:'||sqlerrm||'@ p_row'|| p_row ||'-p_cel-'|| p_cel ||'-p_value-'|| p_value);
     end;
     
Procedure save_xl(p_excel_name varchar2) is
Begin

CLIENT_OLE2.Release_Obj(worksheet);
CLIENT_OLE2.Release_Obj(worksheets);
-- Save the Excel file created
If p_excel_name is not null then
args := CLIENT_OLE2.Create_Arglist;
CLIENT_OLE2.Add_Arg(args,p_excel_name);
CLIENT_OLE2.Invoke(workbook, 'SaveAs', args);
CLIENT_OLE2.Destroy_Arglist(args);
end if;
EXCEPTION
          WHEN OTHERS THEN
               PROC_EXECLOG( :SYSTEM.CURRENT_FORM||'.PKG_EXCEL.save_excel, error:'||sqlerrm);

End;     
     
procedure save(p_excel_name varchar2) IS
     BEGIN
If p_excel_name is not null then
args := CLIENT_OLE2.Create_Arglist;
--CLIENT_OLE2.Add_Arg(args,p_excel_name);
CLIENT_OLE2.Invoke(workbook, 'Save', args);
CLIENT_OLE2.Destroy_Arglist(args);
end if;
     EXCEPTION
          WHEN OTHERS THEN
               PROC_EXECLOG( :SYSTEM.CURRENT_FORM||'.PKG_EXCEL.save_excel, error:'||sqlerrm);
END;
     
PROCEDURE close_excel IS
BEGIN
     --CLIENT_OLE2.INVOKE(application, 'Quit');
     CLIENT_OLE2.RELEASE_OBJ(worksheet);
     CLIENT_OLE2.RELEASE_OBJ(worksheets);
     CLIENT_OLE2.RELEASE_OBJ(workbook);
     CLIENT_OLE2.RELEASE_OBJ(workbooks);
     --CLIENT_OLE2.RELEASE_OBJ(application);
     CLIENT_OLE2.INVOKE(Application, 'Quit');
     CLIENT_OLE2.RELEASE_OBJ(application);
EXCEPTION
          WHEN OTHERS THEN
               PROC_EXECLOG(:SYSTEM.CURRENT_FORM||'.PKG_EXCEL.close_excel, error:'||sqlerrm);

END;
END;

Thanks in Advance
  • 1. Re: Webutil Error
    vansul Pro
    Currently Being Moderated
    workbooks := CLIENT_OLE2.GET_OBJ_PROPERTY(APPLICATION, 'Workbooks');
    workbook := CLIENT_OLE2.GET_OBJ_PROPERTY(Workbooks,'open',args);

    replace the above two lines with

    workbook := CLIENT_OLE2.GET_OBJ_PROPERTY(APPLICATION,'open',args);

    or with
    workbook := CLIENT_OLE2.invoke_OBJ(APPLICATION,'open',args);


    it depends upon client os is XP or other version like 2008 etc.
  • 2. Re: Webutil Error
    user2974660 Newbie
    Currently Being Moderated
    Thanks a lot
  • 3. Re: Webutil Error
    vansul Pro
    Currently Being Moderated
    if it is correct answer then mark the correct.
    and for helpful answers you should always mark as helpful so that if anybody searches for any solution then he may refer the solutions.
  • 4. Re: Webutil Error
    Askdineshsingh Explorer
    Currently Being Moderated
    THE ABOVE ANSWER IS CORRECT IF STILL ERROR PERSISTS THEN
    You have to sign you jacob.jar and webutil.jar with jar_signer.
    both the files located in Devsuite_home directory under forms subdirectory. if you need more help
    on how to sign jacob.jar, webutil.jar then mark this post as helpful and intimate me by replying this...

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points