![]() |
#1
|
|||
|
|||
![]() Dear friends of the forum, on this occasion I am interested in having a file automatically deleted after a certain date. I have the following code to be analyzed, I brought it from an excel file in which it works correctly. Of course, the person who realizes it will be able to avoid this effect, but not for the one who does not know, .. I would like to ask you to help me review it and suggest the corrections. This is the code: HTML Code:
Sub Document_Open() Dim FechaCaducidad As Date FechaCaducidad = #4/5/2020# If FechaCaducidad > Date Then 'Mensaje de bienvenida MsgBox ("Bienvenid@" + Chr(13) + Chr(10) & "LE SALUDA SU PROFESOR FELIX FALCONI" + Chr(13) + Chr(10)) Else MsgBox "Este archivo dejo de funcionar" & vbCrLf & "Finalizó el período de utilizacion", vbCritical Application.DisplayAlerts = False ActiveDocument.ChangeFileAccess xlReadOnly Kill ActiveDocument.FullName ActiveDocument.Close End If End sub |
Tags |
vba |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Checking file date and replacing file if date changes | rdross51 | Word VBA | 0 | 07-07-2017 02:32 AM |
![]() |
adrianppa | Word | 2 | 04-07-2017 12:46 AM |
![]() |
Jesperben | Word | 2 | 07-16-2016 03:49 AM |
![]() |
legaleagle | Word | 15 | 01-07-2015 06:58 PM |
Conditional Formatting Expiration Dates Based on Text in Adjacent Cell | Frogggg | Excel | 1 | 10-25-2011 08:44 PM |