Below is some code that worked perfectly fine in another one of my VB apps.
Copy pasted the code.... and now the listbox doesn't populate even though there is 9 lines in the TXT file.
Lines in the TXT file
OpenBalCHK
OpenBalSAV
OpenBalCSH
AllocatedinCHK
Bill
Checking
Savings
Assets
Cash
I am not sure why it doesn't work in this new app.
Any Ideas...
Code:
Public Sub loadLstACCT()
'Public lstACCTPath = txtDefPath.Text & "mmslistaccounts.txt"
Try
'CLEAR LIST
lstACCT.Items.Clear()
'LOAD FILE
Dim lines() As String = IO.File.ReadAllLines(lstACCTPath)
lstACCT.Items.AddRange(lines.ToArray())
Catch Err As Exception
MessageBox.Show(Err.Message)
End Try
End Sub
I am trying to see what the loaded file looks like, but can't seem to figure out why I can't convert it to a string.
FYI... in the debugger I generate no errors.
Thanks