LAUNCH EXCEL ::::::::::::::::::::::::::::::: declare appl_name varchar2(255); begin if :global.application_id is not null then message ('Application is already running'); else appl_name := 'C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE'; :global.application_id := dde.app_begin(appl_name, dde.app_mode_normal); end if; exception when dde.dde_app_failure then message ('Could not lanch application for DDE operations'); raise form_trigger_failure; when others then message('Error: '||to_char(sqlcode)||' '||sqlerrm); raise form_trigger_failure; end; OPEN CHANNEL :::::::::::::::::::::::::::::::::::::: begin if :global.channel_id is not null then message ('Communication channel has already been established'); elsif :global.application_id is null then message ('The application has to be launched first'); else :global.channel_id := dde.initiate('EXCEL','BOOK1'); end if; exception when dde.dde_init_failed then message ('Could not initialize DDE communication channel'); raise form_trigger_failure; when dde.dmlerr_no_conv_established then message ('Could not established DDE communication channel'); raise form_trigger_failure; when others then message('Error: '||to_char(sqlcode)||' '||sqlerrm); raise form_trigger_failure; end; EXIT EXCEL :::::::::::::::::::::::::::::::::::::::::: declare application_ID PLS_INTEGER; begin if :global.application_id is null then message ('Cannot shutdown application not initiated by this application'); else application_id := to_number(:global.application_id); dde.app_focus(application_id); dde.app_end(application_id); :global.application_id := null; :global.channel_id := null; end if; exception when dde.dde_app_not_found then message ('Could not find applications for DDE opeartions'); raise form_trigger_failure; when others then message('Error: '||to_char(sqlcode)||' '||sqlerrm); raise form_trigger_failure; end;