Problema con FileSearch
Publicado por CarLos (1 intervención) el 12/05/2007 10:22:27
Estoy intentando que Execute me devuelva solo el nombre del archivo. (sin la ruta de ubicacion de este).
¿ Alguien me echa una mano ?
Set fs = Application.FileSearch
With fs
.LookIn = ThisWorkbook.Path
'.LookIn = "E:\DirectorioA\DirectorioB "
If ActiveSheet.OLEObjects("CheckBox1").Object.Value = True Then
.Filename = "*.*.*.XLS"
Else
.Filename = "*-*.XLS"
End If
If .Execute > 0 Then
MsgBox "Se han encontrado " & .FoundFiles.Count & _
" archivos."
f = 1
For i = 1 To .FoundFiles.Count
s = .FoundFiles(i)
p = .FoundFiles.Item(i) ' Lo intento con Item y me devuelve tambien la ruta
Cells(i + f, 29).Value = s
Cells(i + f, 28).Value = p
Call Comprueba
If Cells(i + 2, 4).Value <> "" Then
f = f + 1
End If
Next i
Gracias de antemano
Next i
¿ Alguien me echa una mano ?
Set fs = Application.FileSearch
With fs
.LookIn = ThisWorkbook.Path
'.LookIn = "E:\DirectorioA\DirectorioB "
If ActiveSheet.OLEObjects("CheckBox1").Object.Value = True Then
.Filename = "*.*.*.XLS"
Else
.Filename = "*-*.XLS"
End If
If .Execute > 0 Then
MsgBox "Se han encontrado " & .FoundFiles.Count & _
" archivos."
f = 1
For i = 1 To .FoundFiles.Count
s = .FoundFiles(i)
p = .FoundFiles.Item(i) ' Lo intento con Item y me devuelve tambien la ruta
Cells(i + f, 29).Value = s
Cells(i + f, 28).Value = p
Call Comprueba
If Cells(i + 2, 4).Value <> "" Then
f = f + 1
End If
Next i
Gracias de antemano
Next i
Valora esta pregunta


0