ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¥¨¶°°±¤î½Ð±Ð

[µo°Ý] ¥¨¶°°±¤î½Ð±Ð

©³¤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

¦^´_ 1# bqwangs
§Ú²q§A¬O­n³o¼Ë§a....

³Ì¤W­±¥[­Ó¥þ°ìÅܼÆ
Public gbStop as Boolean
­×§ïcrMain
  1. Sub crMain()
  2.     gbStop = False
  3.     lastM = 0
  4.     Do
  5.         If lastM <> fMdfd Then
  6.             lastM = fMdfd
  7.             getCSV
  8.         End If
  9.         DoEvents
  10.     Loop Until gbStop
  11. End Sub
½Æ»s¥N½X
¥t·s¼W(«ö¶s©I¥s¦¹¥¨¶°)
  1. Sub UserStop()
  2.     gbStop = True
  3. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¹D¼w¬O´£ª@¦Û§Úªº©ú¿O¡A¤£¸Ó¬O¨þ¥¸§O¤HªºÃ@¤l¡C
ªð¦^¦Cªí ¤W¤@¥DÃD