Application.FileSearch fejler
Jeg har problemer med Application.FileSearch ikke virker på alle PC'er men kun på nogle, er der noget med windows installation der skal opdateres, eller den fil der skal bruges ikke er på den forventet plads.Private Sub cmdKillFile_Click()
Set fs = Application.FileSearch
Dim Parth1 As String
Dim Con1 As String
Dim Content As String
Parth1 = ImageParth
With fs
.LookIn = Parth1
.FileName = "*.*"
If .Execute > 0 Then
MsgBox "There were " & .foundfiles.Count & _
" file(s) found."
For i = 1 To .foundfiles.Count
Con1 = InaktivImage(Mid(.foundfiles(i), 42))
If Con1 <> "OK" Then
If MsgBox("Slet fil.: " & Mid(.foundfiles(i), 42), vbYesNo) = vbYes Then
Kill .foundfiles(i)
End If
End If
Next i
Else
MsgBox "There were no files found."
End If
End With
Me.txtInaktiveImage.Value = Content
End Sub
