CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 1999
    Posts
    16

    "Class does not support Automation"

    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,



  2. #2
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: "Class does not support Automation"

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured