VBA-tools / VBA-JSON

JSON conversion and parsing for VBA
MIT License
1.76k stars 568 forks source link

OpenTextFile Problem #170

Closed Magicmercury closed 4 years ago

Magicmercury commented 4 years ago

I´ve trying to start a little bit testing but i have a big problem. I can´t read a file.

`Public Sub exceljson() Dim FSO As New FileSystemObject Dim JsonTS As TextStream Dim JsonText As String Dim Parsed As Dictionary

' Read .json file Set JsonTS = FSO.OpenTextFile("example.json", ForReading) JsonText = JsonTS.ReadAll JsonTS.Close End Sub`

I got the Error at the line Set JsonTS - Can´t find a file. But the file is in the same folder.

What did I wrong?

Thanks

houghtonap commented 4 years ago

You probably need to use the full path to the file.


From: Magicmercury notifications@github.com Sent: Friday, May 29, 2020, 9:58 AM To: VBA-tools/VBA-JSON Cc: Subscribed Subject: [VBA-tools/VBA-JSON] OpenTextFile Problem (#170)

I´ve trying to start a little bit testing but i have a big problem. I can´t read a file.

`Public Sub exceljson() Dim FSO As New FileSystemObject Dim JsonTS As TextStream Dim JsonText As String Dim Parsed As Dictionary

' Read .json file Set JsonTS = FSO.OpenTextFile("example.json", ForReading) JsonText = JsonTS.ReadAll JsonTS.Close End Sub`

I got the Error at the line Set JsonTS - Can´t find a file. But the file is in the same folder.

What did I wrong?

Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/VBA-tools/VBA-JSON/issues/170, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIKTRA7UWTI76TPJ5ZWM443RT65O3ANCNFSM4NOB74QA.

Magicmercury commented 4 years ago

Sorry...your are right, I make a huge mistake..