Public Sub 获取文件基础名称() Dim fso As Scripting.FileSystemObject Dim myfile As String myfile = ThisWorkbook.Path & "\技巧18-028.xls" Set fso = New Scripting.FileSystemObject '这句老出错,说控件不能创建对象 MsgBox "该文件的基础名称为:" & fso.GetBaseName(myfile) Set fso = Nothing End Sub
是不是要引用什么控件,还是什么原因?? 问题已得到398老师解答,答案在6楼!
[此贴子已经被作者于2008-2-21 19:56:38编辑过] |