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

[µo°Ý] ¸ê®Æ§¨´M§ä¤å¦rÀɮצWºÙ°ÝÃD´M°Ý

[µo°Ý] ¸ê®Æ§¨´M§ä¤å¦rÀɮצWºÙ°ÝÃD´M°Ý

DEAR ALL ¤j¤j -
1.¤p§Ì½Ð±Ð¤§°ÝÃD»¡©ú¦p¤U
1.1   \\89.80.70.1\design\add_word ¤U¦³¤@°ï¤å¦rÀÉ.TXT ÀÉ®×. ¨Ò: SPL321A  S16987A  Q16222A .....
1.2 EXCEL ¤§ SHEET.RANGE("A1")=ÀɮצWºÙ.°õ¦æ¤@¥\¯àÁä«á©ó\\89.80.70.1\design\add_word ¤U§ä´M
    ¦³µL¬Û¦P¦WºÙ¤§¤å¦rÀÉ.¦³©ó SHEET.RANGE("A2")¥NTRUE  µL©óSHEET.RANGE("A2")¥NFALSE
     ¨Ò:·í SHEET.RANGE("A1")=S16987A ®É.´M§ä \\89.80.70.1\design\add_word ¤U¦³¤@°ï¤å¦rÀÉ.TXT ÀÉ®×
      ¦³²Å¦X¤§ÀɮצWºÙ.©óSHEET.RANGE("A2")¥NTRUE.
     ¨Ò:·í SHEET.RANGE("A1")=S19999A ®É.´M§ä \\89.80.70.1\design\add_word ¤U¦³¤@°ï¤å¦rÀÉ.TXT ÀÉ®×
      µL²Å¦X¤§ÀɮצWºÙ.©óSHEET.RANGE("A2")¥NFALSE.
ù

DEAR  Joforn  ¤j¤j
100%²Å¦X»Ý¨D.·PÁ±z THANKS*10000
ù

TOP

  1. Option Explicit
  2. #If VBA7 Then
  3.   Private Declare PtrSafe Function PathIsDirectoryW Lib "shlwapi.dll" (ByVal pszPath As LongPtr) As Long
  4.   Private Declare PtrSafe Function PathFileExistsW Lib "shlwapi.dll" (ByVal pszPath As LongPtr) As Long
  5. #Else
  6.   Private Declare Function PathIsDirectoryW Lib "shlwapi.dll" (ByVal pszPath As Long) As Long
  7.   Private Declare Function PathFileExistsW Lib "shlwapi.dll" (ByVal pszPath As Long) As Long
  8. #End If

  9. '检测¤å¥ó¬O§_¦s¦b
  10. Public Function FileExists(ByVal strPath As String) As Boolean
  11.   strPath = strPath & String(5, vbNullChar)
  12.   If PathFileExistsW(StrPtr(strPath)) Then
  13.     FileExists = PathIsDirectoryW(StrPtr(strPath)) = 0
  14.   End If
  15. End Function

  16. Public Sub FilesExists()
  17.   Dim I As Long
  18.   For I = 1 To Range("A" & Rows.Count).End(xlUp).Row
  19.     Range("B" & I).Value = FileExists("\\89.80.70.1\design\add_word\" & Range("A" & I).Value & ".TXT")
  20.   Next I
  21. End Sub
½Æ»s¥N½X
¥@¬É¨º»ò¤j¡A¥i§Ú·Q¥h­þ¡H

TOP

        ÀR«ä¦Û¦b : ºw¤ô¦¨ªe¡C²É¦Ì¦¨ÅÚ¡A¤Å»´¤vÆF¡A¤Å¥Hµ½¤p¦Ó¤£¬°¡C
ªð¦^¦Cªí ¤W¤@¥DÃD