08-23-2010, 12:58 PM
Hi,
Below is the modified code...........................
But it is throwing a syntax error while executing this "Datatable.AddParameter("CustonerName"),Global Sheet)"
Regards,
Anu
Below is the modified code...........................
Code:
Dim xlSheet,xlBook, xlApp,a,CustomerName,Address,datatable
Const ForAppending = 8
const TristateTrue=-1
file_location = "C:\Test.xlsx"
'Dim iCol : iCol = 0
'----------'For Wirting in Excel Sheet'
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.WorkBooks.Open("C:\Test.xlsx")
Set xlSheet = xlBook.WorkSheets("Sheet1")
'To add the column names "Name","Address" for the data table.
Datatable.AddParameter("CustonerName"),Global Sheet)
Datatable.AddParameter("Address"),Global Sheet)
'To fetch the row count from the web table
intrcount=Browser("Browser").Page("Page").WebTable("DataTable").WebTable("Table").GetRoProperty("eows")
For temp=1 to intrcount-1 step 1
Datatable.setcurrentrow(temp)
strcustname=Browser("Browser").Page("Page").WebTable("DataTable").WebTable("Table").GetCellData(temp,"Name")
straddress=Browser("Browser").Page("Page").WebTable("DataTable").WebTable("Table").GetCellData(temp,"Address")
strcustname=Datatable.Value("Name")
straddress=Datatable.Value("Address")
'To click the Next page
If ((temp%10)=0) Then
Browser("Browser").Page("Page").WebTable("DataTable").WebTable("Table").Link("Next").Click
Browser("Browser").Page("Page").Sync
Wait 2
End If
Next
Wait 3
Datatable.Export "C:\Test.xlsx"
xlApp.DisplayAlerts = False
xlBook.Save
'xlBook.Close
xlApp.Quit
Set xlApp = Nothing
Set xlBook = Nothing
Set xlSheet = Nothing
But it is throwing a syntax error while executing this "Datatable.AddParameter("CustonerName"),Global Sheet)"
Regards,
Anu