席主习 于2013-10-15 22-30-30:
Option Compare Database
'判断文件夹是否存在:
Public Function FileFolderExists(strFullPath As String) As Boolean
On Error GoTo EarlyExit
If Not Dir(strFullPath, vbDirectory) = vbNullString Then FileFolderExists = True
EarlyExit:
On Error GoTo 0
End Function
''判断文件夹是否存在:
'Public Sub TestFolderExistence()
' If FileFolderExists("c:\windows\") Then
' MsgBox "指定的文件夹存在!"
' Else
' MsgBox "指定的文件夹不存在!"
' End If
'End Sub
'
''判断文件是否存在:
'Public Sub TestFileExistence()
' If FileFolderExists("d:\Book1.xls") Then
' MsgBox "指定的文件存在!"
' Else
' MsgBox "指定的文件不存在!"
' End If
'End Sub