Aki esta remodelada:
Salu2
Código [Seleccionar]
Dim ruta As String
Dim ext As String
Public Function Sacartodo(cadena As String)
Dim a As Variant
Dim c As Variant
Dim cont As Integer
Dim cont2 As Integer
Dim b As String
For i = 1 To Len(cadena)
b = Mid(cadena, i, 1)
If b = "\" Then
cont = cont + 1
End If
If b = "." Then
cont2 = cont2 + 1
End If
Next
a = Split(cadena, "\")
ruta = a(cont)
a = Split(cadena, ".")
ext = a(cont2)
End Function
Private Sub Form_Load()
Dim cadena As String
cadena = "C:\Hendrix\torero\programa.exe"
Sacartodo cadena
MsgBox ruta
MsgBox ext
End Sub
Salu2