Myspace Comments | Download movies | Machine Tool | Online Advertising | The eBay Song
Help with VB for a newb [Archive] - PCMech Forums

PDA

View Full Version : Help with VB for a newb


darkside
11-11-2003, 03:21 PM
Private Sub Command1_Click()

Dim fso As New Scripting.FileSystemObject
Set fs = New Scripting.FileSystemObject
If fs.FileExists(Text1.Text & Text2.Text) Then
MsgBox ("The file was found")
Else
MsgBox ("The file was not found")
End If

End Sub


What is wrong with this? I get an error when i click on the button that says 'user defined type not defined' and it highlights fso As New Scripting.FileSystemObject.

Any help appreciated

doctorgonzo
11-12-2003, 09:02 AM
You have to add a reference for the project. Should be under Tools...References or Project...References or something like that. Up will pop a list of libraries you can link to. I am guessing that you need to put a check next to "Microsoft Scripting" because you are trying to use Scripting objects.