- ©«¤l
- 38
- ¥DÃD
- 14
- ºëµØ
- 0
- ¿n¤À
- 58
- ÂI¦W
- 0
- §@·~¨t²Î
- win xp
- ³nÅ骩¥»
- office 2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2013-5-22
- ³Ì«áµn¿ý
- 2020-3-9
|
©³¤Uªº¥¨¶°§Ú³]¦¨¤@¶}ÀÉ´N·|¦Û°Ê°õ¦æcrMain¥¨¶°
¦³¿ìªk³]¤@Ó«ö¶s ©ÎªÌ®Ú¥»¤£¥Î³]«ö¶s
´N¦³¿ìªk±NEXCEL¾ãÓÀÉ®×Ãö³¬¶Ü??
Sub getCSV()
Dim textline As String
Dim myVals As Variant
Dim i As Long
On Error Resume Next
Open ThisWorkbook.Path & "\tttt.csv" For Input As #1
Line Input #1, textline
myVals = Split(textline, " ")
With ActiveSheet
For i = 0 To 1
.Cells(i + 1, 1).Value = myVals(i)
Next
.Range("b5") = myVals(2)
.Range("e5") = myVals(3)
.Range("c5") = myVals(4)
End With
Close #1
End Sub
Sub crMain()
lastM = 0
Do
If lastM <> fMdfd Then
lastM = fMdfd
getCSV
End If
DoEvents
Loop
End Sub
Public Function fMdfd() As Variant
Dim fso As New filesystemobject
Dim theF As file
Set theF = fso.getfile(ThisWorkbook.Path & "\tttt.csv")
fMdfd = theF.DateLastModified
Set fso = Nothing
End Function |
|