![]() |
Run time- working with external data sheet - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming) +--- Thread: Run time- working with external data sheet (/Thread-Run-time-working-with-external-data-sheet) |
Run time- working with external data sheet - sunny rao - 12-08-2008 Run time- working with external data sheet Hi Everybody, 1)Can any body suggest a proper method of storing and retrieving values from external excel sheet during run time. 2) And also proper syntax to pass file path as a parameter in calling function. 'I am using function below Code: ExternalData(C:\book1,Global) 'Here I count the rows and trying to use string compare function ------ appExcel.quit a) I keep on getting syntax error in the called function (Expected ")" statement) and if I change the syntax to path ExternalData "<C:\book1>","<Global>" The file does not Exist. What is the proper syntax for passing the file path as a parameter to the function. RE: Run time- working with external data sheet - MVChowdary - 12-08-2008 Hi, Use the following syntax. Code: Datatable.Importsheet("filepath"),"sourcesheet","destinationsheet" RE: Run time- working with external data sheet - sunny rao - 12-10-2008 Hi I used ExternalData("C:\book1","Global") and also the above syntax. it works fine however one problem When I tried to save an excel file and the file is already exists at the location. Then an alert comes "File is already exists, Do you want to replace it?" with button "Yes | No | Cancel". Then I am to choosing option manually, I can close that pop up using QTP. but is there any method to clear all the excel cells, so that Excel Pop-up to save does not come at all. RE: Run time- working with external data sheet - MahalakshmiDevi - 11-19-2009 During run time you can import the data to the data table and then on completion of the work you can export the data to excel file. Datatable.Importsheet filename,srcsheet,datatablesheetname Datatable.Export filename if the data is already availabe in the file, it would be over written. RE: Run time- working with external data sheet - v_selvam - 11-19-2009 When ever you are importing or exporting data in excel files, you should not kept the file as opned. Otherwise it will through error message |