I am using the following to open a file for reading in a vbscript. The script fails when I don't open the file in both the main section and the functions using it. Is there a way to open the file once and make it available throughout?
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(myFile.txt", ForReading)