07-19-2012, 09:23 PM
Hey it is still not working I am using the following code
***there are only 2 data values in excel file****
Code:
datatable.Import("C:\Path")
rowcount=DataTable.GetRowCount
For r=1 to rowcount
DataTable.SetCurrentRow(r)
systemutil.Run"C:\Program Files (x86)\Internet Explorer\iexplore.exe"
Browser("Browser").WinEdit("Edit").Set "http://URL"
Browser("Browser").WinToolbar("Page Control").Click(button)
Browser("Browser").Page("AWB - Current Status").WebEdit("airWayBillTrackingNo").Set DataTable("AWBno", dtGlobalSheet)
Browser("Browser").Page("AWB - Current Status").WebButton("Track").Click(button)
'Browser("Browser").Sync
'-----a = Browser("Browser").Page("AWB - Current Status").Check (CheckPoint("AWB - Current Status_2"))
'---------msgbox("The Error for blank AWB : " & a)
'------Browser("Browser").Sync
'-------Browser("Browser").Page("AWB - Current Status_2").Link("Modify Search").Click
'---------b= Browser("AWB - Current Status").Page("AWB - Current Status").Check (CheckPoint("AWB - Current Status"))
'----------msgbox("The Error for AWB not found or only numbers : "& b)
'TODO:Check
strText=Browser("Browser").Page("AWB - Current Status").WebElement("AWB").GetROProperty("innertext")
strText1=Browser("Browser").Page("AWB - Current Status").WebElement("AWBO").GetROProperty("innertext")
strText2=Browser("Browser").Page("AWB - Current Status").WebElement("AWBD").GetROProperty("innertext")
strText3=Browser("Browser").Page("AWB - Current Status").WebElement("FlightD").GetROProperty("innertext")
strText4=Browser("Browser").Page("AWB - Current Status").WebElement("FlightDate").GetROProperty("innertext")
strText5=Browser("Browser").Page("AWB - Current Status").WebElement("Flightno").GetROProperty("innertext")
strText6=Browser("Browser").Page("AWB - Current Status").WebElement("FlightO").GetROProperty("innertext")
strText7=Browser("Browser").Page("AWB - Current Status").WebElement("FlightTime").GetROProperty("innertext")
strText8=Browser("Browser").Page("AWB - Current Status").WebElement("CurrentStatus").GetROProperty("innertext")
'Create Excel app
Set objAppExcel=CreateObject("Excel.Application")
objAppExcel.visible=True
'Open the worksbook
objAppExcel.workbooks.open "C:\Users\User\Desktop\TRACK.xls"
'Set focus on the workbook
objAppExcel.Workbooks("TRACK.xls").Activate
'Create work sheet obj
Set objExcelSheet=objAppExcel.ActiveWorkbook.Worksheets(1)
'Write to work sheet
'Save worksheet
'objExcelSheet.saveAs "C:\Users\User\Desktop\TRACK.xls"
'Clear obj reference
'----Set objExcelSheet=Nothing
'quit app
'----objAppExcel.quit
'-----Set objAppExcel=Nothing
'Write to work sheet
objExcelSheet.cells(r,1)=strText
objExcelSheet.cells(r,2)=strText1
objExcelSheet.cells(r,3)=strText2
objExcelSheet.cells(r,4)=strText3
objExcelSheet.cells(r,5)=strText4
objExcelSheet.cells(r,6)=strText5
objExcelSheet.cells(r,7)=strText6
objExcelSheet.cells(r,8)=strText7
objExcelSheet.cells(r,9)=strText8
'Save worksheet
objExcelSheet.saveAs "C:\Users\User\Desktop\TRACK.xls"
'Clear obj reference
Set objExcelSheet=Nothing
'quit app
objAppExcel.quit
Set objAppExcel=Nothing
Browser("Browser").Close
If r=("2") Then
Exit for
End If
Next