Sub 判断文件夹是否存在()
Dim sfilename As String
sfilename = Application.InputBox(prompt:="请输入文件或文件夹的名称", _
Default:=CurDir, Title:="输入名称", Type:=2)
If sfilename = "False" Then Exit Sub
If Len(Dir(sfilename, vbDirectory)) > 0 Then
MsgBox "输入的文件或文件夹存在"
Else
MsgBox "输入的文件或文件夹不存在!"
End If
End Sub
VBA判断文件夹是否存在
最新推荐文章于 2024-06-03 08:56:05 发布