Click to See Complete Forum and Search --> : "Class does not support Automation"


Ashley Winters
July 10th, 2001, 05:02 PM
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,

John G Duffy
July 10th, 2001, 07:21 PM
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