Micro Focus QTP (UFT) Forums
Extracting Data from Excel Cells - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Extracting Data from Excel Cells (/Thread-Extracting-Data-from-Excel-Cells)



Extracting Data from Excel Cells - bjotorres - 11-14-2008

How do I grab data from a particular cell in Excel to a text file using VBScript?


RE: Extracting Data from Excel Cells - roxer - 12-04-2008

hi, bjotorres
Here is example of code how to Read From Excel File.
Here is example of code how to Write to a File.
How to work with Microsoft Excel Objects you can read here.

Hope this will help you Smile


RE: Extracting Data from Excel Cells - bfakruddin - 12-24-2008

Code:
Function excel()
dim xl

set xl=createobject("excel.application")
xl.visible=true
xl.workbooks.open "path of file .xls"
xl.sheets("sheetid").select

excel=xl.cells(row,column).value
print excel

xl.activeworkbook.save
xl.quit
set xl=nothing
End Function

Call excel()
msgbox excel

Function TextFile(excel)
dim fso,fs

set fso=createobject("scripting.filesystemobject")
set fs=fso.createtextfile("path of file.txt",true)

fs.writeline excel

fs.close

set fs=nothing
set fso=nothing
End Function

print excel
Call TextFile(excel)



RE: Extracting Data from Excel Cells - nageshpv - 01-02-2009

Thanks bfakruddin. Smile