Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Reading an Existing File using FSO
#1
Not Solved
Hi,

I have a file from which I have to read. I have this file at C:\D & S\Users\...\XYZ.txt

I want this path to be assigned to an arugument "File_path" and I have to use "File_path" several times.

I have gone through FileSystemObject but there all the examples are Creating a file and then reading from it but here I already have a file that I have to read from..

I am trying to use this statement -
Code:
Set MyFile = CreateObject("scripting.FileSystemObject").OpenTextFile(file_path, ForReading)

Please guide me through as to how can I assign the file to "File_path"

Thank You.
Reply
#2
Not Solved
@Prabhu : try with the below ex.

For Reading the values from Textfiles :

Code:
Dim fso, ts
Const ForReading = 1
File_path="C:\D & S\Users\...\XYZ.txt"

Set fso = CreateObject("Scripting. FileSystemObject")
Set ts = fso.OpenTextFile(File_path,ForReading,True)
msgbox ts.ReadLine
ts.close
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Reading Global Sheet's DataTable Value Bhuvana 0 1,460 01-05-2020, 10:03 PM
Last Post: Bhuvana
  Reading Value from Java Table arjun.singh 8 23,835 10-11-2017, 02:51 PM
Last Post: sivaji
  Reading data from excel sheet serenediva 1 8,771 03-03-2017, 10:07 AM
Last Post: vinod123
  QTP not reading all properties ishan.mahajan@adp.com 2 2,237 05-04-2016, 10:50 PM
Last Post: supputuri
  Case changes while reading values from inbuilt datatables krishnakittu03 3 2,735 04-28-2015, 11:34 AM
Last Post: kbhargava505

Forum Jump:


Users browsing this thread: 1 Guest(s)