Export to an pre-existing Excel file [message #399125] |
Mon, 20 April 2009 16:44 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
deahayes3
Messages: 203 Registered: May 2006
|
Senior Member |
![doublemint78%40yahoo.com](/forum/theme/orafaq/images/yahoo.png)
|
|
Hello all,
I am using forms 6i, and I need to export some calculations from a form to an already existing Excel file(basically used to update this excel file based on the calcs). I read something about using DDE package, will this work? am I on the right track, are there any more examples I can use?
|
|
|
|
|
Re: Export to an pre-existing Excel file [message #399306 is a reply to message #399299] |
Tue, 21 April 2009 09:34 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
deahayes3
Messages: 203 Registered: May 2006
|
Senior Member |
![doublemint78%40yahoo.com](/forum/theme/orafaq/images/yahoo.png)
|
|
I decided to use DDE package, it works to the point that it opens the pre-existing excel file, but my data is not going in the correct columns and rows any ideas on how to fix this?
DECLARE
appid PLS_INTEGER;
convid PLS_INTEGER;
x NUMBER := 2;
c NUMBER := 4;
rowcol VARCHAR2(30);
v_row VARCHAR2(10);
BEGIN
appid :=
dde.app_begin('c:\program files\microsoft office\office11\excel.exe c:\forms6i\test_file.xls',dde.app_mode_normal);
convid := dde.initiate('EXCEL','c:\forms6i\TEST_FILE.xls');
LOOP
/* Put contents of form field var into Row 3 Column A */
v_row := 'R'||TO_CHAR(x);
rowcol := v_row||'C'||TO_CHAR(c);
dde.poke(convid,rowcol,:control.item4,dde.cf_text,1000);
x := x + 1;
c:= c + 1;
exit when x > 17;
next_record;
END LOOP;
/* close EXCEL and clean up*/
dde.terminate(convid);
|
|
|