Call Excel file from Forms [message #331952] |
Sun, 06 July 2008 22:24 |
lakshmisaran
Messages: 26 Registered: May 2008
|
Junior Member |
|
|
Dear friends,
I've list of excel VBA file which generated the report. All the reports are used world wide and the tough job is whenever any modifications done, need to send the .xls file for more than 200 users.
I'm trying to bring them under one roof. Is there is any possibilities to call those excel files via Forms and access through internet. We use 10g forms, so looking for the possiblities. I dont want to upload or send data to excel, just call the excel macro file from different destinations.
Currently started with this code.
DECLARE
AppID PLS_INTEGER;
BEGIn
AppID := DDE.App_Begin('C:\Program Files\Microsoft Office\OFFICE11/excel.exe g:/risk/xls/position_report.xls',DDE.APP_MODE_MINIMIZED);
END;
Pls. share your suggesstions..
Thanks in advance..
Rgds,
DL
|
|
|
|
Re: Call Excel file from Forms [message #331961 is a reply to message #331952] |
Sun, 06 July 2008 23:54 |
lakshmisaran
Messages: 26 Registered: May 2008
|
Junior Member |
|
|
Hi Friends,
i did like this to find the .xls path
declare
searchType VARCHAR2(10);
extHandler VARCHAR2(100);
exePath VARCHAR2(512);
Extension varchar2(5) := 'xls';
BEGIN
-- Check the format is OK
if substr(Extension,1,1) != '.' then
searchType := '.'||Extension;
else
searchType := Extension;
end if;
:exepath:= 'test';
-- Do the registry lookup for the extension
extHandler := Client_Win_API_Environment.Read_Registry
('HKEY_CLASSES_ROOT\'||searchType,'',false);
:exepath:= exthandler;
-- Then see what executable the handler invokes:
exePath := Client_Win_API_Environment.Read_Registry
('HKEY_CLASSES_ROOT\'||extHandler||'\shell\Open\command',
'',false);
:exepath:= exePath;
END;
I'm receiving "Webutil Object group not available in this form, Webutil cannot work"
Where did i stuck up?
Rgds,
DL
|
|
|
|
Re: Call Excel file from Forms [message #331983 is a reply to message #331952] |
Mon, 07 July 2008 02:26 |
lakshmisaran
Messages: 26 Registered: May 2008
|
Junior Member |
|
|
Hi all,
Atlast i succeed.
1. I created a form with text box and button.
2. attached webutil.pll
3. Subclassed webutil.olb
4. It didnt work when i run in my local system.
5. When i put the link in server, it worked fine.
below is the coding to find the excel path in the client sytem.
declare
searchType VARCHAR2(10);
extHandler VARCHAR2(100);
exePath VARCHAR2(512);
Extension varchar2(5) := 'xls';
BEGIN
-- Check the format is OK
if substr(Extension,1,1) != '.' then
searchType := '.'||Extension;
else
searchType := Extension;
end if;
:exepath:= searchType;
-- Do the registry lookup for the extension
extHandler := Client_Win_API_Environment.Read_Registry
('HKEY_CLASSES_ROOT\'||'.XLS',chr(0),True);
:exepath:= nvl(exthandler,'no valeu');
-- Then see what executable the handler invokes:
exePath := Client_Win_API_Environment.Read_Registry
('HKEY_CLASSES_ROOT\'||extHandler||'\shell\Open\command', chr(0),True);
:exepath:= nvl(exePath,'no value');
END;
Thanks all for the support
Rgds,
DL
|
|
|
Re: Call Excel file from Forms [message #332201 is a reply to message #331952] |
Mon, 07 July 2008 20:42 |
lakshmisaran
Messages: 26 Registered: May 2008
|
Junior Member |
|
|
Dear friends,
Here is the simple code to call the excel file from Forms
begin
webutil_host.NonBlocking( 'rundll32 url.dll,FileProtocolHandler ' || 'G:\LAKSHMI\rsk_position_report.xls' );
exception
when others then
message(sqlerrm||error_code||error_text);
end;
Thx for the support
Rgds,
DL
|
|
|
Re: Call Excel file from Forms [message #332279 is a reply to message #332201] |
Tue, 08 July 2008 01:37 |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
lakshmisaran wrote on Tue, 08 July 2008 03:42 | Dear friends,
Here is the simple code to call the excel file from Forms
begin
webutil_host.NonBlocking( 'rundll32 url.dll,FileProtocolHandler ' || 'G:\LAKSHMI\rsk_position_report.xls' );
exception
when others then
message(sqlerrm||error_code||error_text);
end;
Thx for the support
Rgds,
DL
|
What is the use of the exception handler? What does it do? What would happen if you removed it?
|
|
|
|