Utterly Bamboozled
New Member
- Joined
- Jul 7, 2010
- Messages
- 39
Hi all,
Can't work out why the file reference below (myFile = "C:\Users\WP\Documents\" & Range("A1").Value & ".txt") results in Excel constantly freezing.
The file exists and the myFile string is correct...
Any ideas?
Thanks!
Can't work out why the file reference below (myFile = "C:\Users\WP\Documents\" & Range("A1").Value & ".txt") results in Excel constantly freezing.
The file exists and the myFile string is correct...
Any ideas?
Code:
Function BarStringInfo() As String
Dim myFile As String
Dim text As String
Dim textline As String
Dim posLat As Integer
Dim posLong As Integer
[B]myFile = "C:\Users\WP\Documents\" & Range("A1").Value & ".txt"[/B]
Open myFile For Input As #1
Do Until EOF(1)
Line Input #1, textline
text = text & textline
Loop
Close #1
BarStringInfo = text
End Function
Thanks!