Dim File
As Variant
Dim aFile
As Variant
Dim i
As Integer
File
= Application.GetOpenFilename
("Excel 文件
,*.xls
;*.xlsx
;*.xlsm"
)
If File
<> False Then
aFile
= Split
(File
, "\"
)
FileName
= aFile
(UBound(aFile
))
FullName
= aFile
(0)
For i
= 1 To (UBound(aFile
) - 1)
FullName
= FullName
& "\"
& aFile
(i
)
Next
Else
End
End If
MsgBox "完整路径是:"
& FullName
MsgBox "文件名是:"
& FileName
代码执行后效果如下 1、 2、 3、
转载请注明原文地址: https://lol.8miu.com/read-86.html