'Script to insert an order and print the Order Number
'Create an object to interact with Excel Library
Set xlapp = CreateObject("Excel.Application")
'Open the excel workbook
Set wbook = xlapp.workbooks.Open("E:\InsertOrder.xls")
'Set the pointer to the worksheet
Set wsheet = xlapp.worksheets(1)
'Get rowcount
rowcount = wsheet.usedrange.rows.count
For i = 1 to rowcount-1
Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("New").Click
Window("Flight Reservation").WinObject("Date of Flight:").Type wsheet.cells(i+1,1).Value
Window("Flight Reservation").WinComboBox("Fly From:").Select wsheet.cells(i+1,2).Value
Window("Flight Reservation").WinComboBox("Fly To:").Select wsheet.cells(i+1,3).Value
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Name:").Set wsheet.cells(i+1,4).Value
Window("Flight Reservation").WinButton("Insert Order").Click
Wait 8
Orderno = Window("Flight Reservation").WinEdit("Order No:").GetRoProperty("text")
wsheet.cells(i+1,5).value = Orderno
If Window("Flight Reservation").Exist(8) Then
wsheet.cells(i+1,6).Value = "Pass"
wsheet.cells(i+1,6).Font.Colorindex = 10
Else
wsheet.cells(i+1,6).Value = "Fail"
wsheet.cells(i+1,6).font.colorindex = 3
End If
Next
wbook.save
wbook.close
xlapp.quit
Set wsheet = nothing
Set wbook = nothing
Set xlapp = nothing
/* Tynt Insight tracker
----------------------------------------------- */
4 comments:
nice posts..
Hadoop online training .All the basic and get the full knowledge of hadoop.
Hadoop online training
thank you for providing useful content. it is very useful for students and followers.microstrategy online training
thank you for providing useful content. it is very useful for students and followers.online microstrategy training
This post is really nice and informative. The explanation given is really comprehensive and useful... microstrategy training
Post a Comment