Exporting to excel [message #381923] |
Tue, 20 January 2009 05:32 |
bechara.daccache
Messages: 14 Registered: September 2008 Location: Lebanon
|
Junior Member |
|
|
Dear all,
Im working on a screen that contains a button that extract some unbound fields to an excel sheet.
Everything is working fine, it is extracting well using the TEXT_IO package.
But when I created a macro on my excel sheet, oracle is not extracting any data to this sheet...
And I have another problem that every time I open the excel sheet, it usually has some compatibility troubles.
Here is an example of the WHEN_BUTTON-PRESSED trigger concerning the button that extracts into excel:
declare
MYFILE TEXT_IO.FILE_TYPE;
BEGIN
MYFILE := TEXT_IO.FOPEN('C:\Users\bechara.daccache\Desktop\test.xls', 'a');
TEXT_IO.PUTF(MYFILE, get_item_property('block3.text_item8', prompt_text) || ': ');
TEXT_IO.PUTF(MYFILE, ' ');
TEXT_IO.PUTF(MYFILE, test ');
TEXT_IO.PUTF(MYFILE, 'test1\n');
TEXT_IO.PUTF(MYFILE,:block3.text_item8);
TEXT_IO.PUTF(MYFILE, ',\n');
TEXT_IO.FCLOSE(MYFILE);
EXCEPTION
WHEN NO_DATA_FOUND THEN
TEXT_IO.FCLOSE(MYfile);
END;
And an example concerning the WHEN_BUTTON_PRESSED that opens the excel fle :
DECLARE
AppID PLS_INTEGER;
BEGIN
AppID := DDE.App_Begin('C:\Program Files\Microsoft Office\Office12\EXCEL'
||' '||'C:\Users\bechara.daccache\Desktop\test.xls',DDE.APP_MODE_MAXIMIZED);
end;
So please if anyone can help me so I can extract into the excel sheet while it has a macro.
Best Regards,
Bechara [EDITED by DJM: split long line]
[Updated on: Thu, 22 January 2009 00:07] by Moderator Report message to a moderator
|
|
|
|
Re: Exporting to excel [message #384129 is a reply to message #382339] |
Mon, 02 February 2009 04:12 |
bechara.daccache
Messages: 14 Registered: September 2008 Location: Lebanon
|
Junior Member |
|
|
Dear little foot,
The Macro worked just fine,
I used:
DDE.EXECUTE(Conv_ID,'[RUN("Macro1")]',10000);
to run the macro after opening the excel sheet.
Thanks anyway,
Regards,
Bechara
|
|
|
|
Re: Exporting to excel [message #385616 is a reply to message #384138] |
Tue, 10 February 2009 04:50 |
bechara.daccache
Messages: 14 Registered: September 2008 Location: Lebanon
|
Junior Member |
|
|
Dear all and SUHAS22845 ,
I attached the fmb of a test form that i created that contains some buttons and some examples of the code I used to extract to excel, add columns, save and run a macro.
Hope it will be useful.
Regards,
Bechara
|
|
|