Private Sub Command2_Click()
Dim MyBooks As Excel.Workbooks, sBook As Excel.Workbook
Dim MySheet As Excel.Worksheet
Dim iRow%, iCol%
Dim sFilename$, sXlsFile$
Dim iFileNum%
Dim sBuff$, sChr$
Dim iSt%, iEn%, iLen%
Dim i%
iFileNum = FreeFile
Open "C:\1.txt" For Binary As iFileNum
sBuff = String(FileLen("C:\1.txt"), " ")
Get iFileNum, , sBuff
Close iFileNum
Set sBook = Excel.Workbooks.Open("C:\1.xls")
Set MySheet = Excel.ActiveWorkbook.ActiveSheet
sBook.Application.Visible = True
sBook.Worksheets(1).Visible = True
iSt = 1
iEn = 1
sChr = ","
iRow = 1
Do While iEn > 0
For i = 1 To 3
iCol = i
iEn = InStr(iSt, sBuff, sChr)
If iEn = 0 Then Exit For
MySheet.Cells(iRow, iCol) = Mid(sBuff, iSt, iEn - iSt)
iSt = iEn + 1
Next
iRow = iRow + 1
Loop
MySheet.Cells(iRow, iCol) = Mid(sBuff, iSt, Len(sBuff) - iSt)
End Sub