Demo entry 6624264

Hola mundo

   

Submitted by anonymous on Jun 14, 2017 at 22:35
Language: VB.net. Code size: 911 Bytes.

Option Explicit

Sub Crear_Carpeta_Y_Guardar()
    
    Dim sRuta As String
    Dim sNombreCarpeta As String
    Dim sSeparadorRuta As String
    Dim sNombreLibroActual As String
    
    sNombreLibroActual = Application.ActiveWorkbook.Name
    sSeparadorRuta = Application.PathSeparator
    
    sRuta = Application.ActiveWorkbook.Path
    sNombreCarpeta = CStr(Format(Date, "dd-mm-yyyy")) _
    & "-" & CStr(Format(Time, "hh-mm-ss"))
    
    If Dir(sRuta & sSeparadorRuta & sNombreCarpeta, vbDirectory) = Empty Then
        MkDir (sRuta & sSeparadorRuta & sNombreCarpeta)
    End If
    
    Application.ActiveWorkbook.SaveCopyAs Filename:=sRuta _
    & sSeparadorRuta & sNombreCarpeta & sSeparadorRuta & sNombreLibroActual
    
    Application.StatusBar = "Una copia se guardó en: " & sRuta _
    & sSeparadorRuta & sNombreCarpeta & sSeparadorRuta & sNombreLibroActual
    
End Sub

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).