buscar un fichero en la unidad C
Publicado por Miguel (281 intervenciones) el 04/03/2016 17:23:57
Esta función tiene que darme el Path del fichero, pero me sale un error de "Base no válida". Podría alguien decirme donde tengo el fallo.
Un saludo y gracias
1
2
3
4
5
6
7
8
9
10
11
12
13
Public Function BuscaRuta(ByVal Fichero As String) As String
Try
Dim tempStr As String, Ret As Long
tempStr = Convert.ToString(260, 0) 'Error : Base no válida
Ret = SearchTreeForFile("c:\", Fichero, tempStr)
If Ret <> 0 Then
Return Left$(tempStr, InStr(1, CInt(tempStr), Convert.ToChar(0)) - 1)
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
Return vbNullString
End Try
End Function
Un saludo y gracias
Valora esta pregunta


0