Public Function MakeDirFullPath(ByVal sPath As String) As Boolean
On Error GoTo error
'crear todo el path de un directorio
If Right(sPath, 1) = "\" Then
sPath = Left(sPath, Len(sPath) - 1)
End If
Dim SplitPath() As String
SplitPath = Split(sPath, "\")
Dim Value As Integer
Dim Merge As String
For Value = 0 To UBound(SplitPath)
If Value <> 0 Then
Merge = Merge & "\"
End If
Merge = Merge & SplitPath(Value)
If Dir(Merge, vbDirectory) = "" Then
MkDir Merge
End If
Next
SetAttr sPath, vbNormal
MakeDirFullPath = True
Exit Function
error:
MakeDirFullPath = False
Debug.Print Err.Description
End Function
Suscribirse a:
Enviar comentarios (Atom)
VBA Access. Redondeo de números decimales con el método medio redondeo. Alternativa a la función Round (bankers round)
Private Function Redondeo(ByVal Numero As Variant, ByVal Decimales As Integer) As Double 'Aplica método medio redondeo (half round ...
-
Option Compare Database Option Explicit '***************************** ' 'Ejemplo de uso ' 'selecciona 1 ficher...
-
Option Compare Database Option Explicit 'Zip / UnZip file or folder 'http://www.codekabinett.com/rdumps.php?Lang=2&targetDoc...
No hay comentarios:
Publicar un comentario