Hi..
Something like this..
Assumes it is Excel files you're looking for..
Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then
strFile = [K1]
Z = Filter(Split(CreateObject("wscript.shell").exec("cmd /c Dir """ & strFile & "*.xls"" /s/b/O-D").stdout.readall, vbCrLf), ":")
[L1] = Z(0): [M1] = Z(1)
CheckBox1.Caption = "TRUE"
Else
[L1] = "": [M1] = ""
CheckBox1.Caption = "FALSE"
End If
End Sub
Private Sub CheckBox2_Click()
If CheckBox2.Value = True Then
strFile = [K2]
Z = Filter(Split(CreateObject("wscript.shell").exec("cmd /c Dir """ & strFile & "*.xls"" /s/b/O-D").stdout.readall, vbCrLf), ":")
[L2] = Z(0): [M2] = Z(1)
CheckBox2.Caption = "TRUE"
Else
[L2] = "": [M2] = ""
CheckBox2.Caption = "FALSE"
End If
End Sub
Bookmarks