Hi everyone,
Seeking some help on below;
i have created a Userform with Listbox, Textbox & Lable
the Listbox shows the list of files are folder based on the path mentioned in Textbox.
the Dir Path is well restricted and Textbox is not Visible so that user cannot go to desired path.
Now in a Sheet (eg: Sheet7(i + 1, 1) ) i have list of Mandatory files a Folder should have to consider as Completed.
if those files exist no matter what extension the Lable caption as Complete else Lable Caption as InComplete.
Code
Private Sub Label17_Click()
Dim FilePath As String
Dim oFile As String
Dim i As Integer
FilePath = ""
On Error Resume Next
FilePath = dir(pdir.Text)
On Error GoTo 0
For Each oFile In FilePath
Sheet7.Cells(i + 1, 1) = oFile
i = i + 1
If oFile = "" Then
MsgBox "File doesn't exist", vbOKOnly
Else
MsgBox "File exist", vbOKOnly
End If
Next oFile
End Sub
Display More
Can some one Please Help me on this.
Thanks alot.