帮忙看一下这段代码

来源:百度知道 编辑:UC知道 时间:2024/05/16 15:42:48
Private Sub CommandButton1_Click()
Dim fso As New FileSystemObject
Dim fil As Folder
If fso.FolderExists("c:\abc") Then
Set fil = fso.DeleteFolder("c:\abc")
End If
End Sub
运行为什麽提示函数未定义
有导入包含FileSystemObject这个类库
我是在WORD 的VB下做的

提示fso.DeleteFolder未定义函数或变量

必须添加引用Microsoft Scripting Runtime,FileSystemObject不在VB6的内部类库中

没有FileSystemObject
这个东西

有吧,是文件操作的一个函数吧.楼主把没定义的函数帖出来看看.我觉得你写得没什么错误.

有没有导入包含FileSystemObject这个类库?