|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (9 bit)
Join Date: Jul 2003
Location: Sheffield, UK
Posts: 292
|
Help with VB for a newb
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 |
|
|
|
|
|
#2 |
|
Professional gadfly
|
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.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|