Dim numberOfEdits
'Create a Description object
Set oDesc = Description.Create()
oDesc("micclass").Value = "WebEdit"
'Retrieve all WebEdit objects from this page.
Set editCollection = Browser("Shipping").Page("Shipping").ChildObjects(oDesc)
numberOfEdits = editCollection.Count
'insert all retrieved information in an Excel file.
For i = 0 To numberOfEdits - 1
CurrentInfo = editCollection(i).GetROProperty("text")
WriteToExcelFile (CurrentInfo)
Next
' inseting values into excel
Function WriteToExcelFile (CurrentInfo)
Dim oExcel, oWB, oSheet, setVal
Set oExcel=CreateObject("Excel.Application")
Set oWB=oExcel.Workbooks.Open("C:\test.xls")
Set oSheet=oWB.WorkSheets("Sheet1")
oExcel.Visible=TRUE
For i = 0 To CurrentInfo - 1
oSheet.Cells(i,1).Value=CurrentInfo
Next
oWB.Save
oWB.Close
Set oExcel=Nothing
End Function
No comments:
Post a Comment
Note: only a member of this blog may post a comment.