Few days ago I was browsing a forum where there was a requirement to open an excel file on click of a button. I thought of it and tried to implement it. Following code helped me to achieve the same in my local environment. I wrote this on Applet Server Script.
if(MethodName == “invoke1″)
{
//To Open an Excel Sheet use the following command in escript
var TestApp = COMCreateObject( “Excel.Application”);
TestApp.Workbooks.Open(“c:\\test.xls”);
//To read values from the cells of the Excel Sheet
var val = ExApp.ActiveSheet.Cells(15,4).Value
//Close the sheet after the use with the following command
ExApp.Quit();
//To check if it has been properly read or not
TheApplication().RaiseErrorText(val);
return(CancelOperation);
}
But the question that is now hanuting me is
Will this code work (after modification of path of course) on thin client where the siebel server is on UNIX or Sun Solaris systems?
It will work on Local system as most of us have Windows OS and COM components are readily available for our use.
Have any of you guys tried this? If yes please share you experience with us.
Otherwise I will try and let you all know the outcome.

4 Comments at "Interacting with Word and Excel through COM"
Hi,
I implemented this code…. it is working fien …. Can u please tell me can we run the .exe file on click of button ?
Piyush
Let me research on it and will let you know the output
[...] my Previous Post I had specified how we can communicate with word and excel using ComCreateObject function [...]
I know it is late reply but still it is here.
This post will help to understand how we can run exe file from siebel.
http://siebelunleashed.com/comcreateobject-%e2%80%93-opening-an-exe-file/
Comment Now!