ralphy
asked on
fileexists
In vb4 I'm trying to have a button either setup a program(if it is not on the computer) or shell to the program if it is already there. I would like to use an If....Else but I can't figure out how to use the fileexists wording.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Oh, you are using vb4. Try and see if getattr exists. If it does just replace vbFileAttribute with the return type of getattr
ASKER
I still get the user defined type not defined msg for getattr
Public Function fileExist(fileName As String) As Boolean
Dim l As Long
On Error Resume Next
l = FileLen(fileName)
fileExist = Not (Err.Number > 0)
On Error GoTo 0
End Function
Dim l As Long
On Error Resume Next
l = FileLen(fileName)
fileExist = Not (Err.Number > 0)
On Error GoTo 0
End Function
ASKER
Thanks alot mirkwood, Looks like it'll work fine.
Ralphy
Ralphy
ASKER