How to write a data in excel file - 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 write a data in excel file (/Thread-How-to-write-a-data-in-excel-file) |
How to write a data in excel file - kamalakannan_anandan - 06-07-2011 Hi, I am new to QTP. I want to create a calculator to test in qtp. 1)Input should be data sheet : Rows = 20 Column =3 The columns and rows should have numbers 2)The output should be excel with the results of the following functions Addition, subtraction, division, multiplication I am able to do step 1,read data from DataTable. using import excel file in DataTable. using calc application, i able to add value but i want to write in excel file. Code: strData1 = DataTable.Value(1,1) Please any one help me to this task. Thanks & Regards, Kamalakannan Anandan RE: How to write a data in excel file - vIns - 06-07-2011 Hi, To write in datatable... Code: DataTable.Value("column name","sheet name") = result To export the datatable... Code: DataTable.Export "file path" RE: How to write a data in excel file - kamalakannan_anandan - 06-08-2011 Hi VIns, Thanks for replying my queries. I will explain clearly, about my task. I want to create a new test program calculator application. Read data from data table in QTP, i entering data in Default.xls file in my test program folder. Now i am importing the default.xls file in to my global data table in qtp. I am able to read all the rows and colomn, and i able to add data using calculator application. Now i want to write result add, sub, mul and div value to excel data. Please find the sample code of my program. '''Code Code: Dim nRow ''*****************************************************************************''' Code: ''' Addition I want to write result in excel file. Please help me to solve this issue. Thanks & Regards, Kamalakannan Anandan RE: How to write a data in excel file - Arul - 08-20-2011 Hi, Try this Code: 'Set objExcel = CreateObject("Excel.Application") regards, Arul.D RE: How to write a data in excel file - Ankesh - 08-23-2011 Code: Set ObjExcel=CreateObject("Excel.Application") 'to write values to the cells.... Code: objWorksheet.cells(1,1)="Property" RE: How to write a data in excel file - sshukla12 - 08-24-2011 Hi, i think this will help you. Append the row and write again Code: Dim fso Correct me if wrong. Regards, Sankalp |