"Latebound assignment to a field of value type 'myFiles' is not valid when 'myFiles' is the result of a latebound expression.
at Microsoft.VisualBasic.CompilerServices.LateBinding.LateSetComplex"
Am reading a file into an array, am getting a late binding error...can anyone see why its complaining???
cheers George
Code:Public Sub FileCountLoad(ByRef myFiles2) 'OK Check if the file is there, if there Load it 'If not create file from standard master template Dim FileReader As StreamReader Dim LineIn As String Dim FieldArray() As String Dim Index As Integer ChkMasterList(myFileList) 'Check todays file is there Index = 0 Try FileReader = File.OpenText(myFileList) While FileReader.Peek <> -1 LineIn = FileReader.ReadLine() FieldArray = Split(LineIn, ",") myFiles2(Index).SPname = FieldArray(0) myFiles2(Index).RRDname = FieldArray(1) myFiles2(Index).Total = FieldArray(2) myFiles2(Index).Freq = FieldArray(3) Debug.WriteLine("Sp Name: " & myFiles2(Index).SPname & ", RRD Name:" & myFiles2(Index).RRDname & ", Category: " & myFiles2(Index).Total & ", Category: " & myFiles2(Index).Freq) Index += 1 End While FileReader.Close() Catch ex As Exception Debug.WriteLine("Friendly Error message, " & ex.ToString & "and" & ex.Message) End Try End Sub


Reply With Quote
