Sub 分离文件名和扩展名_()
Dim fso As New Scripting.FileSystemObject
Dim sfilename As String
Dim str1 As String
sfilename = ThisWorkbook.FullName
str1 = "本工作簿文件的全名:" & fso.GetFileName(sfilename)
str1 = str1 & vbCrLf & vbCrLf
str1 = str1 & "基础名:" & fso.GetBaseName(sfilename)
str1 = str1 & vbCrLf & vbCrLf
str1 = srt1 & "扩展名:" & fso.GetExtensionName(sfilename)
MsgBox str1, vbInformation + vbOKOnly, "提示"
Set fso = Nothing
End Sub
09-03
2863
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)