How to use the same Excel sheet for 2 different Actions? - 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 use the same Excel sheet for 2 different Actions? (/Thread-How-to-use-the-same-Excel-sheet-for-2-different-Actions) |
How to use the same Excel sheet for 2 different Actions? - Uma - 09-29-2011 Hi, I am using one Excel sheet(It has 9 pages,1st page for action 1 and all the other 8 pages for Action 2). Both the Actions are Reusable. If I run my script the First Action opens the Excel sheet and it works fine. My code for first action Code: Set xlWrkbk = xlApp.Workbooks.Open("C:\ListMan.xls") Object required: 'xlWrkbk' Because I didn't use the line Code: (Set xlWrkbk = xlApp.Workbooks.Open("C:\ListMan.xls")) Code: Set xlApp = GetObject("","Excel.Application") I used only the following line. Code: Set xlWrksht = xlWrkbk.Worksheets("MyDraft") ........ How to use the same Excel sheet for different Actions,without opening and closing againa nd again. Any help? Thank you Uma RE: How to use the same Excel sheet for 2 different Actions? - rajpes - 09-29-2011 use "Importsheet" method action2 script: Code: Datatable.Importsheet("C:\ListMan.xls","MyDraft1",Action2) RE: How to use the same Excel sheet for 2 different Actions? - Uma - 09-30-2011 Hi Raj, Thank you for the solution the code is working,but I did a small modification, DataTable.ImportSheet "C:\ListMan.xls","Excelsheetname","actionname" Uma RE: How to use the same Excel sheet for 2 different Actions? - rajpes - 09-30-2011 that is what i meant dear |