Ex: create a Excel with a below data
Name Sal
Test 1000
Demo 2000
save it as Testdata in C drive(if you are using lesser than Ms office 2010 then extension is .xls)
Set xl =createobject("excel.application")
set wb=xl.workbooks.open("C:\Testdata.xlsx")
set sh=wb.worksheets(1)
rc=sh.usedrange.rows.count
for i=2 to rc
Msgbox "Name: "& sh.cells(i,1).value &vbnewline&" Sal:"&sh.cells(i,2).value
Next
wb.close
xl.quit
set xl=nothing
set wb=nothing
set sh=nothing
Name Sal
Test 1000
Demo 2000
save it as Testdata in C drive(if you are using lesser than Ms office 2010 then extension is .xls)
Set xl =createobject("excel.application")
set wb=xl.workbooks.open("C:\Testdata.xlsx")
set sh=wb.worksheets(1)
rc=sh.usedrange.rows.count
for i=2 to rc
Msgbox "Name: "& sh.cells(i,1).value &vbnewline&" Sal:"&sh.cells(i,2).value
Next
wb.close
xl.quit
set xl=nothing
set wb=nothing
set sh=nothing