Urgent! Problem with DDE Execution [message #84542] |
Mon, 29 March 2004 03:37 |
Ranjith Peddireddy
Messages: 7 Registered: June 2002
|
Junior Member |
|
|
Hi all,
I have a requirement as below..
I'm trying to export data from an Oracle Table to an Excel Sheet using DDE. I was able to transfer the data to Excel Sheet , but unable to save the Excel sheet.
Here is the code ::
DECLARE
AppID PLS_INTEGER;
ConvID PLS_INTEGER;
Buffer CHAR(10000);
rowcol CHAR(10);
rowcol1 CHAR(10);
rowcol2 CHAR(10);
rowcol3 CHAR(10);
x number;
cursor c1 is select field1,field2, field3 from Table;
BEGIN
AppID := DDE.App_Begin('D:Program FilesMicrosoft OfficeOfficeexcel.exe d:test.xls',DDE.APP_MODE_MAXIMIZED);
ConvID := DDE.Initiate('excel', 'd:test.xls');
rowcol := 'R1C1';
dde.poke(convid,rowcol,'Exporting Data from Oracle Table to Excel',dde.cf_text,1000);
x := 3;
for cur1 in c1
loop
rowcol1 := 'R'||to_char(x)||'C1';
dde.poke(convid,rowcol1,cur1.field1,dde.cf_text,1000);
rowcol2 := 'R'||to_char(x)||'C2';
dde.poke(convid,rowcol2,cur1.field2,dde.cf_text,1000);
rowcol3 := 'R'||to_char(x)||'C3';
dde.poke(convid,rowcol3,cur1.field3,dde.cf_text,1000);
x := x + 1;
end loop;
DDE.EXECUTE(Convid,'[[FileSaveas "D:test.xls"]]', 10000);
dde.terminate(ConvID);
dde.app_end(AppID);
END;
I should be able to save the xls without prompting .. and terminate.
Thanks in Advance
Bye.
|
|
|