![]() |
How to retrieve data from excel to datatable - 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: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners) +--- Thread: How to retrieve data from excel to datatable (/Thread-How-to-retrieve-data-from-excel-to-datatable) |
How to retrieve data from excel to datatable - shwetha_m - 02-01-2012 Hi, Please can any one let me know how to retrieve data from excel to datatable? Regards, Shwetha RE: How to retrieve data from excel to datatable - mohitbnsl - 02-01-2012 Hi, Please find the Code below: Code: set objexcel = createobject("Excel.application") Also find the attached screenshot of the excel i was using. Regards, Mohit RE: How to retrieve data from excel to datatable - Ankesh - 02-02-2012 Hi Shwetha, In order to get the datas from excel to QTp datatable, QTp provides import feture... Use the below code Datatable.Import "C:\SampleFile.xls","<SheetNameInExcel(SourceSheet)>","<SheetNameIn Datatable(Destination Sheet)>" please refer to QTp help for more information. Regards, Ankesh RE: How to retrieve data from excel to datatable - shwetha_m - 02-02-2012 Hi Mohit, I have created the excel which is attached by you. and copied the same script in QTP. when i run the script it displays error as : ActiveX component can't create object: 'Excel.application' Line (1): "set objexcel = createobject("Excel.application")". Please help me on this. Regards, Shwetha RE: How to retrieve data from excel to datatable - rajpes - 02-02-2012 shwetha, you need to install msoffice in your computer |