Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to retrieve data from excel to datatable
#2
Solved: 12 Years, 11 Months, 1 Week ago
Hi,

Please find the Code below:

Code:
set objexcel = createobject("Excel.application")
Set objWorkbook = objExcel.WorkBooks.Open("D:\ExcelTest.xls")
Set objDriverSheet = objWorkbook.Worksheets("Sheet1")
cc = objDriverSheet.usedrange.columns.count
rc = objDriverSheet.usedrange.rows.count
for i = 1 to rc
rname = objDriverSheet.cells(i,1).Value
if rname ="TEST_002" then
for j = 2 to cc
fieldvalue = fieldvalue & " " & objDriverSheet.cells(i,j)
next
end if
'End for
next
msgbox fieldvalue

objexcel.quit
Set objexcel=Nothing
Set objDriverSheet=Nothing
Set objWorkbook=Nothing


Also find the attached screenshot of the excel i was using.

Regards,
Mohit


Attached Files Image(s)
   
Reply


Messages In This Thread
RE: How to retrieve data from excel to datatable - by mohitbnsl - 02-01-2012, 11:19 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Error as Global Not defined while trying to retrieve value from Datatable siddharth1609 0 1,325 09-11-2019, 02:52 PM
Last Post: siddharth1609
  Cannot retrieve Native property JeL 1 1,547 07-29-2019, 05:41 PM
Last Post: JeL
  Want to read the data from excel and set read value in the JavaTable rajeevk7 0 2,799 07-10-2017, 04:20 PM
Last Post: rajeevk7
  dtLocalSheet empty even though excel file contains data cantorre 2 3,098 05-10-2017, 12:47 PM
Last Post: vidhi
  Reading data from excel sheet serenediva 1 10,470 03-03-2017, 10:07 AM
Last Post: vinod123

Forum Jump:


Users browsing this thread: 1 Guest(s)