View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 399
Default Understanding this code snippett

Len(string) give you the length (number of characters) in the given text
string. Since your string is a path to a file (actually the return of the
Dir function checking that path), if the path is not good, Len returns 0.
In effect, it seems to be checking whether you have a valid file path.

You can get more (and better!) info by going into the VBE Help and looking
at both Dir and Len.

Ed

"Stuart" wrote in message
...
I have 'found' these lines:

If Len(Dir(Application.Path & "\" & "abc.exe")) = 0 _
Or Len(Dir(Application.Path & "\" & "xyz.dll")) _
= 0 Then
MsgBox " very long message "
Exit Sub
End If
Load UserForm1
UserForm1.Show
End Sub

What exactly is the If statement trying to determine,
please?

Regards.