07-30-2010, 03:33 PM
Hi Anu,
Try with the below code.
Note: Its written in Descriptive Prog., no need of adding objects in OR.
Directly copy below code > paste > Run > Check O/P in excel
Make sure excel file exist in the path "F\Test.xls"
Try with the below code.
Note: Its written in Descriptive Prog., no need of adding objects in OR.
Directly copy below code > paste > Run > Check O/P in excel
Make sure excel file exist in the path "F\Test.xls"
Code:
Systemutil.Run "www.google.com"
Searched_Item="Page"
Browser("title:=Google").Page("title:=Google").WebEdit("name:=q").Set Searched_Item
Browser("title:=Google").Page("title:=Google").WebButton("name:=Google Search").Click
Dim xlApp
Set xlApp=CreateObject("Excel.Application")
xlApp.WorkBooks.Open("C:\Documents and Settings\Sreee\Desktop\Test.xls")
xlApp.Sheets("Sheet1").Select
Set obj=description.Create
obj("micclass").Value="Link"
Set x=Browser("title:="&Searched_Item&" - Google Search").Page("title:="&Searched_Item&" - Google Search").ChildObjects(obj)
temp=0
For i=0 to x.count-1
If (instr(1,x(i).GetROproperty("Innertext"),Searched_Item)>0) Then
xlApp.Cells(1,temp+1).Value=(x(i).GetROproperty("Innertext"))
xlApp.Cells(1,temp+1).font.Bold=True
temp=temp+1
End if
Next
xlApp.ActiveWorkBook.Save
xlApp.Quit
Set xlApp=Nothing