我正在尝试将文件拆分为数组。
Structure Users
Dim Name As String
Dim Surname As String
Dim Address As String
Dim AccountNo As String
Dim PIN As String
Dim Balance As Decimal
End Structure
这是我需要填充XSL
文件的结构;可以轻松将其更改为CSV
。
我只需要帮助将此文件拆分为结构即可。
Sub LoadDatabase(ByRef Accounts() As Users, ByVal lineCount As Integer)
Dim file(lineCount) As Users
FileOpen(1, "Database.xsl", OpenMode.Input)
file = Input(LOF(1), 1)
For i = 1 To lineCount
Accounts(i).Name = Split(file(i), ",")
Next
FileClose(1)
End Sub
Excel文件如下所示: