Logo
Home Cart [Log In] About Us Contact Us

Object Reference

xf_InteractInteraction

Public Function SafeDir (
s As String,
Optional Attributes As VbFileAttribute = vbNormal
) As String

wraps the VBA 'Dir' function, suppressing any error message and returning an empty string if there is an error. While calling Dir with a nonexistent path does not cause an error, calling it with a nonexistent drive letter does.
See Dir function for use.
This is only for the initial call: if getting the next path use Dir().

s as String

the string containing the Dir path

Optional Attributes as VbFileAttribute = vbNormal

The Attribute mask for the directory query (see the VBA 'Dir' function)

Call Template:

Dim s As String
s = xf.Interact.SafeDir(s)
s = xf.Interact.SafeDir(s, Attributes)

See Also:

Example 1:

; s = SafeDir("G:\temp\Temp*.txt")
note this is a simple example
Contact Us :: About Us :: Policies :: email: infspamo@arrospamw-of-tispamme.com    © 2012 Arrow Of Time Pty Ltd