Error while opening text file through QTP - 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: Error while opening text file through QTP (/Thread-Error-while-opening-text-file-through-QTP) |
Error while opening text file through QTP - SarodeGirish - 06-14-2012 Hello All, Code: set fsoObj=createobject("scripting.filesystemobject") After executing the above code I am getting the error as "Invalid procedure call or argument" . the path "D:\bhim\one.txt" does exist. Thanks & regards Girish sarode RE: Error while opening text file through QTP - manabh - 06-14-2012 After set fsoObj=createobject("scripting.filesystemobject") verify fsoObj <> nothing RE: Error while opening text file through QTP - Shridevi.Salagare - 06-14-2012 Name of the file should not be file..as its a keyword.Use some other name. Try this code Code: Const ForReading = 1, ForWriting = 2, ForAppending = 8 RE: Error while opening text file through QTP - ssvali - 06-14-2012 Hi, There are two mistakes in ur code 1. file - is a default keyword, it should not be used. 2. Instead of ForWriting you have to use number, ie - 2 Const 1 = ForReading, 2 = ForWriting, 8 = ForAppending Try below code Code: Set fsoObj=createobject("scripting.filesystemobject") (06-14-2012, 04:13 PM)manabh Wrote: After set fsoObj=createobject("scripting.filesystemobject") verify fsoObj <> nothing RE: Error while opening text file through QTP - SarodeGirish - 06-16-2012 It's executed. Thanks Shridevi Hello All, Dim oBrowser Set oBrowser = Description.Create While ececuting the above code in .vbs file only,I am getting the error as "object required Description". I am not using QTP. Many thanks for viewing this thread. -Girish RE: Error while opening text file through QTP - sandya - 06-25-2012 Please try this code: Code: create for reading=1,create for writing=2,create for append mode=8. |