Esta macro no me pone bien la hora, algo hago mal
En esta macro, hago algo mal, no me pone la hora bien.
Esta es la macro:
' Código para TOMAR FOTO
Sub TomaFoto()
'Act.Por.Dante Amor
Dim Izq As Single, Arr As Single, Ancho As Single, Alto As Single
Dim Wordapn As Object
Application.DisplayAlerts = False
ActiveSheet.Unprotect Password:="1"
ruta = ThisWorkbook.Path
With Selection
Izq = .Left: Arr = .Top: Ancho = .Width: Alto = .Height: .CopyPicture
End With
Set Wordapn = CreateObject("Word.Application") 'crear nueva aplicación Word
With Wordapn
.Visible = True
.Activate
End With
Wordapn.Documents.Add 'crear nuevo documento Word
Wordapn.Selection.PasteAndFormat 13 'Type:=wdListCombineWithExistingList
Wordapn.ActiveDocument.SaveAs "J:\" & ActiveSheet.Name & " " & Format(Date, "dd-mm-yyyy hh.mm.ss") & ".docx" 'guardar como
Wordapn.Quit
Application.DisplayAlerts = True
Call Tomar_Foto
End Sub
Sub Tomar_Foto()
'Act.Por.Dante Amor
ActiveSheet.Unprotect Password:="1"
Application.DisplayAlerts = False
On Error Resume Next
Sheets("FOTO1").Activate
Dim Izq As Single, Arr As Single, Ancho As Single, Alto As Single
Application.DisplayAlerts = False
With Selection
Izq = .Left: Arr = .Top: Ancho = .Width: Alto = .Height: .CopyPicture
End With
With ActiveSheet.ChartObjects.Add(Izq, Arr, Ancho, Alto)
.Chart.Paste
.Chart.Export "J:\" & ActiveSheet.Name & " " & Format(Date, "dd-mm-yyyy hh.mm.ss") & ".jpg"
.Delete
End With
Application.DisplayAlerts = True
End Sub
El nombre de la hoja, bien, la fecha, bien y en la hora mal.
La hora me la escribe así, 00.00.00, y no se corregirla.
PacoAdra 03-06-2017 00.00.00