Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to copy webpage into excel using qtp
#4
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi

Try this, below script is the edited one, will give you the perfect output xls file
Code:
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("Sheet1")

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
objWorkbook.save
objWorkbook.close
objExcel.Quit
set objExcel=nothing
Reply


Messages In This Thread
RE: how to copy webpage into excel using qtp - by KavitaPriyaCR - 10-07-2010, 11:40 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  webpage WinObject has same name Ananthakumar_S 0 1,693 11-30-2016, 09:48 PM
Last Post: Ananthakumar_S
  Check specific links of a webpage rocky9 1 2,702 06-11-2015, 06:23 PM
Last Post: venkatesh9032
Exclamation How to verify whether pdf is completely loaded or not in webpage nmakkena 1 2,672 08-27-2014, 04:09 PM
Last Post: vinod123
  Handling .NET framework menu in webpage using QTP 10 vishnu1067 0 2,332 05-15-2014, 05:30 PM
Last Post: vishnu1067
  Comparing webtable data with weblist and webelements in other webpage arnav 1 5,811 04-18-2014, 10:01 PM
Last Post: Parke

Forum Jump:


Users browsing this thread: 1 Guest(s)