Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to set relative path for excel
#3
Solved: 10 Years, 10 Months, 1 Week ago
The test data in excel is stored in D:\Test_Data\Names.xls, if the script has to be run in a different system, where they do have D: drive, and they store the data in C: or any other Drive, the QTP should still be able to fetch the data.

How should I give the path so that data can be fetched from any drive, I tried with the following code, but QTP throws error stating that excel could not be located in the specified path

Code:
Set objWorkbook = objExcel.WorkBooks.Open("..\ ..\Test_Data\InspectCustomer.xls")
Reply


Messages In This Thread
how to set relative path for excel - by kamalteja - 03-27-2008, 12:24 PM
RE: how to set relative path for excel - by kamalteja - 03-28-2008, 11:17 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  how to get relative path by using testdir environment variable Sathyaprasad 1 1,798 11-30-2017, 02:21 AM
Last Post: supputuri
  Want to read the data from excel and set read value in the JavaTable rajeevk7 0 2,178 07-10-2017, 04:20 PM
Last Post: rajeevk7
  Path of Flight reservation Window is not recorded in HP UFT 12.52 version mailtokopalverma@gmail.com 1 2,416 04-01-2016, 05:34 PM
Last Post: vinod123
  X path Identification vasavi.vasavi 1 2,726 07-29-2015, 10:44 AM
Last Post: kbhargava505
  environment variable path for qc automation2012 0 2,644 01-18-2015, 08:18 AM
Last Post: automation2012

Forum Jump:


Users browsing this thread: 1 Guest(s)