Está en la página 1de 2

Sub Auto_Open() caducidad End Sub

Sub Eliminar_archivo() Application.DisplayAlerts = False ActiveWorkbook.ChangeFileAccess xlReadOnly Kill ActiveWorkbook.FullName ThisWorkbook.Close False End Sub

Sub caducidad() 'deshabilitamos boton cancelar del msgbox Application.EnableCancelKey = xlDisabled

fecha = 14/09/2014

If Date < DateSerial(Year(fecha), Month(fecha), Day(fecha)) Then

MsgBox "Dentro de: " & (DateSerial(Year(fecha), Month(fecha), Day(fecha)) - Date) & " dias este archivo se AUTOELIMINARA" & Chr(13) & ", vbInformation, "Tiempo de Expiracin" Else MsgBox "Lo siento, el tiempo de prueba a terminado." & Chr(13) & "Este archivo se autoeliminar." & Chr(13) & " ", vbCritical, "Tiempo de Expiracin"

Call Eliminar_archivo

End If

End Sub

También podría gustarte