Hi all,
I am trying to declare a variable
VB Code:
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
Printable View
Hi all,
I am trying to declare a variable
VB Code:
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
Microsoft Scripting Runtime.
Additionaly, you should not implicitly Define the variable (fs) with the New keyword.
Instead, to be able to release the object, do:
VB Code:
Option Explicit Private Sub Form_Load() Dim fs As Scripting.FileSystemObject Set fs = [b]New[/b] Scripting.FileSystemObject 'Do stuff Set fs = Nothing End Sub