Write in Excel - 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 Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others) +--- Thread: Write in Excel (/Thread-Write-in-Excel) |
RE: Write in Excel - Anu - 08-24-2010 Hi, I want to write data in excel but not in DataTable of QTP. Hope this explain my query and you can provide the work around for this. Waiting dor early response. Regards, Anu Hi, If we can directly write the data in excel then why is there any need to write data in Data Table of QTP? Regards, Anu Hi, If we can write data directly in excel then why is there any need to write in DataTable of QTP and then to excel............... Regards, Anu RE: Write in Excel - Anu - 08-24-2010 Hi, Hope my previous mail explains my query............ Regards, Anu RE: Write in Excel - venkatbatchu - 08-24-2010 Hi Anu, I understood ur query. Datatable is a Excel kind of thing which is similar like Excel. If you want to write the data directly to excel then u need to use Excel objects. It seems your way of thinking is completely writing data into excel. See for this you have two ways. First Way: 1. First fetch the data from web table to data table 2. Now export the data from the data table to excel using Datatable.Export "file path" Second Way: 1. Using Excel objects 2. You need to create objects for excel application, workbook,worksheet Ex: please get some idea by using excel objects Code: Set aa=CreateObject ("Excel.Application") If you still dont get idea, first try to go through Datatable concept from learnqtp tutorial. Note: Did you execute the code which i posted early for fetching data from web table to datatable. Please let me know for further clarification. Regards, Venkat.Batchu RE: Write in Excel - Anu - 08-24-2010 Hi, Yes, i tried the code given by you. If i change the itrcount to 10 then it is not navigating to the next page and if i run the same code then nothing gets write in excel........... Please help!!!!!!!!!!!! Regards, Anu RE: Write in Excel - venkatbatchu - 08-24-2010 Hi Anu, Have you maintained the object repository. If yes means use the implemnetation logic which i have posted earlier. No measn please start doing that. Regards, Venkat.Batchu RE: Write in Excel - Anu - 08-24-2010 Hi, Yes i had maintained my repository and i had already run the code but it is not running properly means it is not writing the data to excel. Please look into my code give me the work around for that because the code give by you is not working at my side.............. Tried many times still not working............. Waiting for response. Regards, Anu RE: Write in Excel - Anu - 08-25-2010 Hi, Please provide me sum work around for my problem so that i can proceed further as my deadline is nearby............ Waiting for early response.......... Regards, Anu RE: Write in Excel - venkatbatchu - 08-25-2010 Hi Anu, Please follow the below approach 1. File-->Settings-->Run-->Run One Iteration only 2. Copy the entire code as I mentioned below 3. Add the objects to object repository as like in the attached screen shot (Here “Phone table” object and “Next link” are in object repository) 4. Execute the script 5. Observe that it will work as expected Code: 'intpages=Total no of pages here it is 293 I hope now u will get some idea. Regards, Venkat.Batchu RE: Write in Excel - Saket - 08-25-2010 Sorry for my ignorance guys, I am not able to go through all the posts in this thread, Anu -actually I dint understand what problem you are facing exactly. please mention the error if you receive any and for which statement. Is there any changes you made there in the code. If i remember it correctly It was working fine earlier, I had also tried the same on your site. I will check if I still have the code with me. also I would like to suggest to close this thread here and start this discussion in a fresh thread as it is going quite lengthy. |