Results 1 to 3 of 3

Thread: User Type

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2005
    Location
    Toronto, Canada
    Posts
    357

    User Type

    Hi all,
    I am trying to declare a variable

    VB Code:
    1. Dim fs As New Scripting.FileSystemObject

    However, I am getting an error: User Type Not Defined

    Could someone help me with what reference I need to be using to solve this problem.

    Khanjan
    Hey... If you found this post helpful please rate it.

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: User Type

    Microsoft Scripting Runtime.

  3. #3
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Re: User Type

    Additionaly, you should not implicitly Define the variable (fs) with the New keyword.
    Instead, to be able to release the object, do:
    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4. Dim fs As Scripting.FileSystemObject
    5.  
    6.     Set fs = [b]New[/b] Scripting.FileSystemObject
    7.    
    8.     'Do stuff
    9.    
    10.     Set fs = Nothing
    11.  
    12. End Sub

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