Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to read files by location, and not file name
#1
Solved: 10 Years, 9 Months ago
Hi,

Currently, I have hardcoded the filenames(OVSource.xls and OVOutput.xml) in the code like:

Code:
Const XMLDataFile = "D:/OVOutput.xml"
Const ExcelDataFile = "D:/OVSource.xls"

Set xmlDoc = CreateObject("Microsoft.XMLDOM")
xmlDoc.async = false
xmldoc.load(XMLDataFile)

Set oExcel = CreateObject("Excel.Application")
oExcel.Visible = false
Set oWBook = oExcel.Workbooks.Open(ExcelDataFile)

......

Is it possible to write code in such a way where the script picks up the available excel file and xml file available in a particular location? In that way, I wouldnt have to worry too much about the filenames.

Thanks in advance,
Liju
Reply
#2
Solved: 10 Years, 9 Months ago
Very much. Keyword you should be looking for is,
Scripting.filesystemobject
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to paste file location in QTP camillelola 0 1,342 08-09-2018, 10:54 AM
Last Post: camillelola
  Want to read the data from excel and set read value in the JavaTable rajeevk7 0 2,171 07-10-2017, 04:20 PM
Last Post: rajeevk7
  Selecting file saved in a location excellentpawan 1 3,816 02-25-2014, 02:05 PM
Last Post: guin.anirban
  QTP Should open files(say txt files) it can be n number from a folder. Shiv Y 1 2,524 12-18-2013, 01:45 AM
Last Post: mlkrqtp
  Copy file to network shared location sams001 0 2,964 04-03-2013, 02:10 AM
Last Post: sams001

Forum Jump:


Users browsing this thread: 1 Guest(s)