I'm writing a sub to pull data from a text file. When trying to run a different form that calls the sub, I am getting the "identifier under the cursor is not recognized" as the reason why after a 424 Object Error. Not sure what is wrong.
Sub loadData()
Dim txtFile As String
Dim dataLine As String
Dim row As Integer, column As Integer
Dim arrayForOneLine() As String
txtFile = ThisWorkbook.Path & "/data.txt"
Open txtFile For Input As #1
Do Until EOF(1)
Line Input #1 , dataLine
arrayForOneLine = Split(dataLine, vbTab)
row = row + 1
ReDim apartmentArray(row)
apartment.name = arrayForOneLine(0)
apartment.bed = arrayForOneLine(1)
apartment.bath = arrayForOneLine(2)
apartment.size = arrayForOneLine(3)
apartment.pool = arrayForOneLine(4)
apartment.cable = arrayForOneLine(5)
apartment.pet = arrayForOneLine(6)
apartment.fitness = arrayForOneLine(7)
apartment.size = arrayForOneLine(8)
Loop
Close #1
End Sub
Sub loadData()
Dim txtFile As String
Dim dataLine As String
Dim row As Integer, column As Integer
Dim arrayForOneLine() As String
txtFile = ThisWorkbook.Path & "/data.txt"
Open txtFile For Input As #1
Do Until EOF(1)
Line Input #1 , dataLine
arrayForOneLine = Split(dataLine, vbTab)
row = row + 1
ReDim apartmentArray(row)
apartment.name = arrayForOneLine(0)
apartment.bed = arrayForOneLine(1)
apartment.bath = arrayForOneLine(2)
apartment.size = arrayForOneLine(3)
apartment.pool = arrayForOneLine(4)
apartment.cable = arrayForOneLine(5)
apartment.pet = arrayForOneLine(6)
apartment.fitness = arrayForOneLine(7)
apartment.size = arrayForOneLine(8)
Loop
Close #1
End Sub