| View previous topic :: View next topic |
| Author |
Message |
Avis Junior Poster

Joined: 07 Oct 2003 Posts: 510 Location: India
|
|
| Back to top |
|
P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Aug 24th, 2004 09:19 AM Post subject: |
|
|
Simpler "
[vb:1:bdd711827a]Public Function CheckDir(ByVal sPath As String) As Boolean
If Dir(sPath, vbDirectory) <> "" Then CheckDir = True
End Function[/vb:1:bdd711827a]
Since the default value is 0 (False) you don't need to set it  _________________ No one is completely useless. They can at least be an example of what to avoid. |
|
| Back to top |
|
rbgCODE Regular
Joined: 11 Nov 2004 Posts: 54 Location: Manchester CT
|
Posted: Nov 15th, 2004 10:29 PM Post subject: |
|
|
snap _________________ '><>
'rBg
'><> |
|
| Back to top |
|
vbman995 Moderator

Joined: 19 Aug 2005 Posts: 264 Location: Planet Earth
|
Posted: Sep 14th, 2005 02:04 PM Post subject: |
|
|
| Hey..... Newbies, this is great code...you can use it to see if a file exists before trying to open it with your program..... |
|
| Back to top |
|
i_am_doofus Regular
Joined: 04 Jun 2005 Posts: 57
|
Posted: Sep 15th, 2005 07:41 AM Post subject: |
|
|
Even easier, add reference to Microsoft Scripting Runtime and use FileSystemObject.FolderExists
| Code: |
Dim fs As FileSystemObject
your_boolean_variable= fs.FolderExists("path_to_your_folder")
|
|
|
| Back to top |
|
|