Hi,
I am getting "Class does not support Automation or does not support expected
interface" when I try to create "Scripting.FileSystemObject". Any
resolution?
Thanks,
Printable View
Hi,
I am getting "Class does not support Automation or does not support expected
interface" when I try to create "Scripting.FileSystemObject". Any
resolution?
Thanks,
Here is a sample that does work. Make sure there is a REFERENCE to "Microsoft Scripting Runtime"
option Explicit
Dim FilSysObj as Scripting.FileSystemObject
Dim DriveCollection as Drives
Dim objDrive as Drive
private Sub Main()
set FilSysObj = new Scripting.FileSystemObject
set DriveCollection = FilSysObj.Drives
for Each objDrive In DriveCollection
If objDrive.IsReady then
MsgBox objDrive & " " & objDrive.AvailableSpace
End If
next
End Sub
private Sub Form_Load()
me.Show
Main
End Sub
John G