![]() |
How to read and write in excel through QTP script - 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 read and write in excel through QTP script (/Thread-How-to-read-and-write-in-excel-through-QTP-script) |
How to read and write in excel through QTP script - shwetha_m - 02-11-2012 Hi I am new to this tool, Can any one pls send me step by step procedure on how to read and write the data in excel? Regards, Shwetha RE: How to read and write in excel through QTP script - rajpes - 02-11-2012 https://www.learnqtp.com/qtp-and-excel-part1/ RE: How to read and write in excel through QTP script - shwetha_m - 02-12-2012 Hi, when i run the below script. Code: rc = DataTable.Value ("A", dtGlobalSheet) Error is displayed as below : The retrieve DataTable.Value operation failed. The <A> column does not exist. Line (2): Code: "rc = DataTable.Value ("A", dtGlobalSheet)". Can anyone please assist on this? Regards, Shwetha RE: How to read and write in excel through QTP script - rajpes - 02-12-2012 shwetha, they are not user defined column names.Double click on that column heading (A) and give some name RE: How to read and write in excel through QTP script - kishorambare - 11-06-2012 [quote='shwetha_m' pid='19969' dateline='1328977787'] Hi I am new to this tool, Can any one pls send me step by step procedure on how to read and write the data in excel? Regards, Shwetha Hi Shweta, PFB: Code: dim ExcelObj ,NewSheet RE: How to read and write in excel through QTP script - venkatesh9032 - 03-14-2014 Hello shwetha...data table is different and excel is different... if you wan t to read the data you should use some functions...i will send the sample code..you willl understand and try to google further... 'Create a new Microsoft Excel object Code: Set myxl = createobject("excel.application") 'To make Excel visible Code: myxl.Application.Visible = true 'Save the Excel file as qtp.xls Code: myxl.ActiveWorkbook.SaveAs "D:\qtp.xls" 'close Excel Code: myxl.Application.Quit 'this is the name of Sheet in Excel file "qtp.xls" where data needs to be entered Code: set mysheet = myxl.ActiveWorkbook.Worksheets("Sheet1") 'Enter values in Sheet1. 'The format of entering values in Excel is Code: excelSheet.Cells(row,column)=value ///Try this.....u will get |