10-08-2010, 10:08 AM
I have got installed QTP for only IE, here is the complete script, with no change you will get the result (Just paste this script, don't record).
And pls et me know if it worked.
Code:
CO_ID=Array(2463,3006,2498)
For k=0 To 2
Set oIE=CreateObject("InternetExplorer.Application")
oIE.Visible=True
oIE.Navigate "http://emops.tse.com.tw/server-java/t05st22_e?TYPEK=sii&step=show&co_id="&Co_ID(k)&"&year=2004"
Set desc=Description.Create()
desc("micclass").value="WebTable"
desc("text").Value="200220032004Capital structure analysis.*"
Set WebEdits=Browser("Title:=Financial Analysis").Page("Title:=Financial Analysis").ChildObjects(desc)
cCount=WebEdits(0).getROProperty("cols")
rCount=WebEdits(0).getROProperty("rows")
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
Set objWorkbook= objExcel.Workbooks.Open("C:\Documents and Settings\Administrator\Desktop\ForumExcel.xls")
Set objSheet=objExcel.Sheets("Sheet"&k+1)
For i=1 To rCount
For j=1 To cCount
data=WebEdits(0).GetCellData(i,j)
If (Instr(data,"analysis (%)") <> 0 OR Instr(data,"flow (%)") <> 0)Then
objsheet.Cells(i,j).Value=data
j=cCount
else
objsheet.Cells(i,j).Value=data
End If
Next
Next
objsheet.Cells(i,j).Value=CO_ID(k)
objWorkbook.Save
objWorkbook.Close
objExcel.Quit
oIE.Quit
Next
And pls et me know if it worked.