谢谢大侠们的提点,现在问题已经解决。
Private Sub cCmdCommand_Click()
Dim iFileNumber As Integer
iFileNumber = FileSystem.FreeFile()
Dim Value As Variant
Dim arrLine() As String
Open "C:\Documents and Settings\WUDING\デスクトップ\kayi\test.txt" For Input As #iFileNumber
Dim stResult As String
Dim i As Long
i = 1
Do While (Not FileSystem.EOF(iFileNumber))
Dim stBuffer As String
Line Input #iFileNumber, stBuffer
arrLine = Split(stBuffer, ",")
vaSpread1.SetText 1, i, arrLine(0)
vaSpread1.SetText 2, i, arrLine(1)
vaSpread1.SetText 3, i, arrLine(2)
vaSpread1.SetText 4, i, arrLine(3)
i = i + 1
Loop
Close #iFileNumber
End Sub
另外想问一下,如果我只想读取文件里的某一条内容,又该怎么办呢?谢谢
[[it] 本帖最后由 kamo 于 2008-8-5 13:26 编辑 [/it]]