Home » Developer & Programmer » Forms » Call Excel file from Forms (Forms 10g, Excel 2003)
Call Excel file from Forms [message #331952] Sun, 06 July 2008 22:24 Go to next message
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 #331958 is a reply to message #331952] Sun, 06 July 2008 23:23 Go to previous messageGo to next message
lakshmisaran
Messages: 26
Registered: May 2008
Junior Member
Hi,

Can anyone tell me how to find the MS office (excel) in each individual user's system.

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 Go to previous messageGo to next message
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 #331968 is a reply to message #331961] Mon, 07 July 2008 00:37 Go to previous messageGo to next message
ora_baby
Messages: 89
Registered: May 2008
Member
i think, that mail is the best way for this work
Re: Call Excel file from Forms [message #331983 is a reply to message #331952] Mon, 07 July 2008 02:26 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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?
Re: Call Excel file from Forms [message #332285 is a reply to message #331952] Tue, 08 July 2008 01:50 Go to previous message
lakshmisaran
Messages: 26
Registered: May 2008
Junior Member
No usage of exception handler. i removed all my prev coding except that exception. Sorry for this...

DL
Previous Topic: Dynamic SET_ITEM_PROPERTY?
Next Topic: How can i create a form?
Goto Forum:
  


Current Time: Mon Dec 02 07:04:19 CST 2024