- ©«¤l
- 109
- ¥DÃD
- 2
- ºëµØ
- 0
- ¿n¤À
- 114
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7 Win10
- ³nÅ骩¥»
- Office 2019 WPS
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ²`¦`
- µù¥U®É¶¡
- 2013-2-2
- ³Ì«áµn¿ý
- 2024-11-6
|
- Option Explicit
- #If VBA7 Then
- Private Declare PtrSafe Function PathIsDirectoryW Lib "shlwapi.dll" (ByVal pszPath As LongPtr) As Long
- Private Declare PtrSafe Function PathFileExistsW Lib "shlwapi.dll" (ByVal pszPath As LongPtr) As Long
- #Else
- Private Declare Function PathIsDirectoryW Lib "shlwapi.dll" (ByVal pszPath As Long) As Long
- Private Declare Function PathFileExistsW Lib "shlwapi.dll" (ByVal pszPath As Long) As Long
- #End If
- '检测¤å¥ó¬O§_¦s¦b
- Public Function FileExists(ByVal strPath As String) As Boolean
- strPath = strPath & String(5, vbNullChar)
- If PathFileExistsW(StrPtr(strPath)) Then
- FileExists = PathIsDirectoryW(StrPtr(strPath)) = 0
- End If
- End Function
- Public Sub FilesExists()
- Dim I As Long
- For I = 1 To Range("A" & Rows.Count).End(xlUp).Row
- Range("B" & I).Value = FileExists("\\89.80.70.1\design\add_word\" & Range("A" & I).Value & ".TXT")
- Next I
- End Sub
½Æ»s¥N½X |
|