Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Write in Excel
#4
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi Saket,

Below is the code..........................

Code:
Dim xlSheet,xlBook, xlApp,a,CustomerName,Address,datatable
Const ForAppending = 8
const TristateTrue=-1
file_location = "F:\Test.xls"
Dim iCol : iCol = 0

'———-’For Wirting in Excel Sheet’
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.WorkBooks.Open("F:\Test.xls")
Set xlSheet = xlBook.WorkSheets("Sheet1")

CountOfRows=Browser("Meghalaya Directory Search").Page("Meghalaya Directory Search_3").WebTable("DataTable").WebTable("Table").RowCount

iCol = iCol + 1

For i = 1 To CountOfRows
    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)
    xlSheet.Rows(i).Columns(iCol).Value =CustomerName
    xlSheet.Rows(i).Columns(iCol + 1).Value =Address
    iNewcolumn=xlSheet.UsedRange.Columns.Count + 1
Next
'xlBook.Save
'xlBook.Close
'xlApp.Quit

Browser("Meghalaya Directory Search").Page("Meghalaya Directory Search_3").WebTable("LinkTable").Link("2").Click

Here i have parameterized the Link(“2″) that is in the object repository.
When i run the script then it automatically goes to the next link and write data to excel sheet by overwritting the previous data.
My problem is that-”I want data should not overwrite instead it should get append same as happen if we write data in txt”

Hope this explains my problem…………………

Regards,
Anu
------------------------------------------------------------------------
Reply


Messages In This Thread
Write in Excel - by Anu - 05-24-2010, 09:45 AM
RE: Write in Excel - by Saket - 05-24-2010, 11:12 AM
RE: Write in Excel - by Anu - 05-25-2010, 09:43 AM
RE: Write in Excel - by basanth27 - 05-24-2010, 02:31 PM
RE: Write in Excel - by Saket - 05-25-2010, 11:08 AM
RE: Write in Excel - by Anu - 05-25-2010, 11:26 AM
RE: Write in Excel - by Saket - 05-25-2010, 12:43 PM
RE: Write in Excel - by Anu - 05-25-2010, 12:54 PM
RE: Write in Excel - by Anu - 05-25-2010, 03:19 PM
RE: Write in Excel - by Saket - 05-25-2010, 03:21 PM
RE: Write in Excel - by Anu - 05-26-2010, 10:20 AM
RE: Write in Excel - by Saket - 05-26-2010, 12:56 PM
RE: Write in Excel - by Anu - 05-26-2010, 03:21 PM
RE: Write in Excel - by Saket - 05-26-2010, 03:22 PM
RE: Write in Excel - by Anu - 05-26-2010, 03:49 PM
RE: Write in Excel - by Saket - 05-26-2010, 03:53 PM
RE: Write in Excel - by Anu - 05-26-2010, 04:54 PM
RE: Write in Excel - by Saket - 05-26-2010, 06:25 PM
RE: Write in Excel - by Anu - 08-23-2010, 10:38 AM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 11:21 AM
RE: Write in Excel - by Anu - 08-23-2010, 12:17 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 12:25 PM
RE: Write in Excel - by Anu - 08-23-2010, 12:42 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 12:48 PM
RE: Write in Excel - by Anu - 08-23-2010, 12:58 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 01:48 PM
RE: Write in Excel - by Anu - 08-23-2010, 02:17 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 02:51 PM
RE: Write in Excel - by Anu - 08-23-2010, 03:03 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 03:07 PM
RE: Write in Excel - by Anu - 08-23-2010, 03:29 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 03:54 PM
RE: Write in Excel - by Anu - 08-23-2010, 04:00 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 04:26 PM
RE: Write in Excel - by Anu - 08-23-2010, 04:47 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 04:59 PM
RE: Write in Excel - by Anu - 08-23-2010, 05:05 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 06:57 PM
RE: Write in Excel - by Anu - 08-24-2010, 09:42 AM
RE: Write in Excel - by venkatbatchu - 08-24-2010, 09:53 AM
RE: Write in Excel - by Anu - 08-24-2010, 11:45 AM
RE: Write in Excel - by venkatbatchu - 08-24-2010, 12:15 PM
RE: Write in Excel - by Anu - 08-24-2010, 01:00 PM
RE: Write in Excel - by venkatbatchu - 08-24-2010, 01:47 PM
RE: Write in Excel - by Anu - 08-24-2010, 03:03 PM
RE: Write in Excel - by Anu - 08-25-2010, 09:18 AM
RE: Write in Excel - by venkatbatchu - 08-25-2010, 05:50 PM
RE: Write in Excel - by Anu - 08-24-2010, 10:01 AM
RE: Write in Excel - by Saket - 08-25-2010, 06:08 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Write in Excel Continued Anu 3 3,315 08-27-2010, 08:53 AM
Last Post: basanth27
  Write Heading in excel Anu 27 19,897 08-05-2010, 03:02 PM
Last Post: Anu

Forum Jump:


Users browsing this thread: 1 Guest(s)