In VBA I’m reading from a text file (it has tags like an xml but its still a txt file).
When running the following code I have come across something kind of strange.
Dim FileName, TextLine, strStore As String
....
TextLine = MyFile.ReadLine
If (TextLine Like "<Store>*") Then
strStore = TextLine
MsgBox (strString) 'for some reason this is outputting a blank msgbox
MsgBox (TextLine) 'this is outputting the expected value
End If
....
As documented in the comments the first MsgBox output is blank while the other outputs the expected data. How is this possible? The code I skipped over is OOS for these variables. What could cause a variable to not be assigned like this?
Cue this noise: http://www.youtube.com/watch?v=LehNm4VVqJI
MsgBox (strString)should beMsgBox (strStore)