Home » Developer & Programmer » Forms » How to kill excel.exe from task manager? (oracle 6i , excel 2003)
How to kill excel.exe from task manager? [message #383829] Fri, 30 January 2009 08:03 Go to next message
canmurt
Messages: 13
Registered: January 2009
Junior Member
I searched the forum but I could not solve my problem..

Can you please help me?

Here is the code...

PROCEDURE abc IS
-- Declare handles to OLE objects
application ole2.obj_type;
workbooks ole2.obj_type;
workbook ole2.obj_type;
worksheet ole2.obj_type;
cell ole2.obj_type;

-- Declare handles to OLE argument lists
args ole2.list_type;

Check_file text_io.file_type;
cell_value VARCHAR2(500);
v_file VARCHAR2(500);
x number := 5;

v_akilli varchar2(100);
v_Urun Varchar2(20);
v_aciklama varchar2(250);
v_top_sat Varchar2(20);
v_mev_stok Varchar2(20);
v_plan_top_stok Varchar2(20);
v_koli_aded Varchar2(20);
v_bek_sip Varchar2(20);
v_yeni_sip Varchar2(20);
v_tarih varchar2(20);

v_Sqlerrm VARCHAR2(250);
v_Sira NUMBER := 0;
BEGIN

-- Check the file can be found, if not exception no_file will be raised
v_file := :islem.txt_path;
Check_file := TEXT_IO.FOPEN(v_File,'R');
TEXT_IO.FCLOSE(Check_file);


application:= ole2.create_obj('Excel.Application');
workbooks := ole2.get_obj_property(application, 'Workbooks');

-- Open the required workbook
args:= ole2.create_arglist;
ole2.add_arg(args, v_file);
workbook := ole2.invoke_obj(workbooks, 'Open', args);
ole2.destroy_arglist(args);

-- Open worksheet Sheet1 of that Workbook
args:= ole2.create_arglist;
ole2.add_arg(args, 'ORDER FORM');
worksheet := ole2.get_obj_property(workbook, 'Worksheets', args);
ole2.destroy_arglist(args);

SET_APPLICATION_PROPERTY(CURSOR_STYLE, 'BUSY');
Set_Block_Property('B_DOSYA', INSERT_ALLOWED, PROPERTY_TRUE);
Loop
-- Get value of cell A1 of worksheet Sheet1
x := x + 1;
args:= ole2.create_arglist;
ole2.add_arg(args, x);
ole2.add_arg(args, 1);
cell:= ole2.get_obj_property(worksheet, 'Cells', args);
ole2.destroy_arglist(args);
cell_value := ole2.get_char_property(cell, 'text');
v_akilli := cell_value;

args:= ole2.create_arglist;
ole2.add_arg(args, x);
ole2.add_arg(args, 2);
cell:= ole2.get_obj_property(worksheet, 'Cells', args);
ole2.destroy_arglist(args);
cell_value := ole2.get_char_property(cell, 'text');
v_Urun := cell_value;

args:= ole2.create_arglist;
ole2.add_arg(args, x);
ole2.add_arg(args, 3);
cell:= ole2.get_obj_property(worksheet, 'Cells', args);
ole2.destroy_arglist(args);
cell_value :=ole2.get_char_property(cell, 'text');
v_aciklama := cell_value;

args:= ole2.create_arglist;
ole2.add_arg(args, x);
ole2.add_arg(args, 4);
cell:= ole2.get_obj_property(worksheet, 'Cells', args);
ole2.destroy_arglist(args);
v_top_sat := ole2.get_char_property(cell, 'text');


args:= ole2.create_arglist;
ole2.add_arg(args, x);
ole2.add_arg(args, 5);
cell:= ole2.get_obj_property(worksheet, 'Cells', args);
ole2.destroy_arglist(args);
cell_value :=ole2.get_char_property(cell, 'text');
v_mev_stok := cell_value;


args:= ole2.create_arglist;
ole2.add_arg(args, x);
ole2.add_arg(args, 6);
cell:= ole2.get_obj_property(worksheet, 'Cells', args);
ole2.destroy_arglist(args);
cell_value :=ole2.get_char_property(cell, 'text');
v_plan_top_stok := cell_value;

args:= ole2.create_arglist;
ole2.add_arg(args, x);
ole2.add_arg(args, 7);
cell:= ole2.get_obj_property(worksheet, 'Cells', args);
ole2.destroy_arglist(args);
cell_value :=ole2.get_char_property(cell, 'text');
v_koli_aded := cell_value;

args:= ole2.create_arglist;
ole2.add_arg(args, x);
ole2.add_arg(args, 8);
cell:= ole2.get_obj_property(worksheet, 'Cells', args);
ole2.destroy_arglist(args);
cell_value := ole2.get_char_property(cell, 'text');
v_bek_sip := cell_value;

args:= ole2.create_arglist;
ole2.add_arg(args, x);
ole2.add_arg(args, 9);
cell:= ole2.get_obj_property(worksheet, 'Cells', args);
ole2.destroy_arglist(args);
cell_value :=ole2.get_char_property(cell, 'text');
v_yeni_sip := cell_value;

args:= ole2.create_arglist;
ole2.add_arg(args, 3);
ole2.add_arg(args, 4);
cell:= ole2.get_obj_property(worksheet, 'Cells', args);
ole2.destroy_arglist(args);
cell_value := ole2.get_char_property(cell, 'text');
v_tarih := substr(cell_value,5,15);


IF nvl(v_urun,'0') = '0' then
ole2.release_obj(cell);
ole2.release_obj(cell);
ole2.release_obj(worksheet);
ole2.release_obj(workbook);
ole2.release_obj(workbooks);
ole2.release_obj(application);
ole2.invoke(application,'Quit');
First_Record;
Exit;
Else
Begin

v_Sira := v_Sira + 1;
INSERT INTO PRKSSS.TEMP_DOSYA_AKTAR_SOFYA(ISLEM_NO ,AKILLI_KOD ,URUN_NO ,URUN_SIRA_NO, ACIKLAMA ,TOPLAM_SATIS ,MEVCUT_STOK ,PLAN_TOP_STOK ,KOLI_IC_ADEDI , BEK_SIPARIS, SIPARIS_ADEDI, TARIH, DURUM_KODU)
VALUES(:global.seq, v_akilli, v_Urun, v_Sira, v_aciklama, v_top_sat, v_mev_stok, v_plan_top_stok, v_koli_aded, v_bek_sip, v_yeni_sip, v_tarih, 0);

EXCEPTION WHEN OTHERS THEN
v_SqlErrm:= substr(sqlerrm,1,250);
-- MESSAGE(V_MGZ||'-'||v_URUN||'-'||V_rAF_sT||'-'||V_dEPO_ST||'-'||V_IADE_MIN_ST||'-'||V_IADE_MIN_YUZDE);
-- PAUSE;
globrout.show_error('Hata-'||v_SqlErrm);

End;

Next_Record;
end if;
End Loop;
Commit;
Set_Block_Property('B_DOSYA', INSERT_ALLOWED, PROPERTY_FALSE);
SET_APPLICATION_PROPERTY(CURSOR_STYLE, 'DEFAULT');

EXCEPTION
WHEN OTHERS THEN
Rollback;
Set_Block_Property('B_DOSYA', INSERT_ALLOWED, PROPERTY_FALSE);
SET_APPLICATION_PROPERTY(CURSOR_STYLE, 'DEFAULT');
IF SQLCODE = -302000 THEN
Globrout.Show_Error('Dosya Bulunamadı.');
Else
v_Sqlerrm := substr(sqlerrm,1,250);
globrout.show_error('Hata-'||v_SqlErrm);
End if;
End;

Regards,



Re: How to kill excel.exe from task manager? [message #384072 is a reply to message #383829] Mon, 02 February 2009 01:57 Go to previous messageGo to next message
canmurt
Messages: 13
Registered: January 2009
Junior Member
anyone can help?
Re: How to kill excel.exe from task manager? [message #384254 is a reply to message #384072] Tue, 03 February 2009 00:42 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Search this forum for 'kill excel'.

David
Re: How to kill excel.exe from task manager? [message #384276 is a reply to message #384254] Tue, 03 February 2009 01:54 Go to previous messageGo to next message
canmurt
Messages: 13
Registered: January 2009
Junior Member
I searched and find very helpful topics but I could not solve my problem... Embarassed Mad
Re: How to kill excel.exe from task manager? [message #384311 is a reply to message #383829] Tue, 03 February 2009 04:02 Go to previous messageGo to next message
pinkalsolanki
Messages: 25
Registered: December 2008
Location: Surat/Gujarat
Junior Member

HI.. do some changes in your coding..
may be it will solve your problem.


1. In Creating " Sheet1 of that Workbook "
use this :
worksheet := ole2.GET_OBJ_PROPERTY(application,'ActiveSheet');
instead of
worksheet := ole2.get_obj_property(workbook, 'Worksheets', args);

2. After getting each value of cell
release cell object with:
OLE2.RELEASE_OBJ(cell);

3. And finally release all objects in this sequence
OLE2.RELEASE_OBJ(worksheet);
OLE2.RELEASE_OBJ(workbook);
OLE2.RELEASE_OBJ(workbooks);
OLE2.INVOKE(application,'Quit');
OLE2.RELEASE_OBJ(application);



Try this.. i think it will help you.
Re: How to kill excel.exe from task manager? [message #385820 is a reply to message #384311] Wed, 11 February 2009 03:50 Go to previous messageGo to next message
canmurt
Messages: 13
Registered: January 2009
Junior Member
no I could not solve my problem yet:( Embarassed
Re: How to kill excel.exe from task manager? [message #385939 is a reply to message #385820] Wed, 11 February 2009 23:45 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Please post your current code. USE CODE TAGS THIS TIME!!

What behaviour is your form exhibiting?

At which line in this code is it performing this behaviour?

David
Previous Topic: Master-detail form and tabs
Next Topic: populate multiple rows from a table to a multi record block
Goto Forum:
  


Current Time: Thu Dec 08 23:45:06 CST 2016

Total time taken to generate the page: 0.10449 seconds