06-03-2010, 11:12 AM
Hi Saket,
The code is bit confusing.One reason is that i do not know Descriptive programming and in this code may be you have used that.
Could you please tell me where to add this code. The code which i am using is mentioned below:
Waiting for your response.
Regards,
Anu
The code is bit confusing.One reason is that i do not know Descriptive programming and in this code may be you have used that.
Could you please tell me where to add this code. The code which i am using is mentioned below:
Code:
Dim xlSheet,xlBook, xlApp,a,CustomerName,Address,datatable
Const ForAppending = 8
const TristateTrue=-1
file_location = "C:\Test.xlsx"
'----------'For Wirting in Excel Sheet'
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.WorkBooks.Open("C:\Test.xlsx")
Set xlSheet = xlBook.WorkSheets("Sheet1")
CountOfRows=Browser("Meghalaya Directory Search").Page("Meghalaya Directory Search_3").WebTable("DataTable").WebTable("Table").RowCount
nRow = xlSheet.UsedRange.Rows.Count
For i = 1 To CountOfRows-1
'a=Browser("Untitled Page").Page("Untitled Page_3").WebTable("Data_Table").GetCellData(i,1)
CustomerName=Browser("Meghalaya Directory Search").Page("Meghalaya Directory Search_3").WebTable("DataTable").WebTable("Table").GetCellData(i,3)
Address=Browser("Meghalaya Directory Search").Page("Meghalaya Directory Search_3").WebTable("DataTable").WebTable("Table").GetCellData(i,4)
nRow = nRow + 1
xlSheet.Rows(nRow).Columns(1).Value =CustomerName
xlSheet.Rows(nRow).Columns(2).Value =Address
Next
xlApp.DisplayAlerts = False
xlBook.Save
'xlBook.Close
xlApp.Quit
Set xlApp = Nothing
Set xlBook = Nothing
Set xlSheet = Nothing
Browser("Meghalaya Directory Search").Page("Meghalaya Directory Search_3").WebTable("LinkTable").Link("2").Click
Waiting for your response.
Regards,
Anu