ThrottleWorks
Excel Ninja
Hi,
My friend is getting a bug while running below mentioned (part of) code on her system.
"File not found" Run time error 53. I tried de-bugging but could not succeed.
My guess is " fso.GetFile(sFile).OpenAsTextStream(1, -2)" this line is trying to open file which is not present at the path.
I tried to get values of different parameters using Ctrl G option but was unable to do so.
Sorry for so little details and asking for help but can anyone please help me what would be the bug cause.
My friend is getting a bug while running below mentioned (part of) code on her system.
"File not found" Run time error 53. I tried de-bugging but could not succeed.
My guess is " fso.GetFile(sFile).OpenAsTextStream(1, -2)" this line is trying to open file which is not present at the path.
I tried to get values of different parameters using Ctrl G option but was unable to do so.
Sorry for so little details and asking for help but can anyone please help me what would be the bug cause.
Code:
Public Function GetDataFromfile(ByVal sFile As String) As String
Dim fso As Object
Dim TS As Object
Set fso = CreateObject("Scripting.FileSystemObject")
'Getting but at below mentioned line
Set TS = fso.GetFile(sFile).OpenAsTextStream(1, -2)
GetDataFromfile = TS.ReadAll
TS.Close
End Function