PDA

View Full Version : Borrado de datos



ojmv30
04-14-2007, 03:05 PM
tengo el siguiente procedimiento que trabaja bien, ( el borrado del rango ), pero al cerrar el archivo pide confirmacion si se desea guardar los cambios,? hay manera de que los cambios se guarden en automatico, tal que no se pida confirmacion?
Sub Auto_Open()
Dim deadline As Date
deadline = "05/31/07"
If Date > deadline Then
With Activesheet.Range("Mi Rango")
.Clear
End With
End If
End Sub

blastpwr1970
04-15-2007, 09:25 AM
Hi,

I want to help too.
Please let me know, if I am out of line!

Here is the transalation and solution.

"I want to save changes without excel asking me to save as."

Try this!



Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.ActiveWorkbook.Save

End Sub


Regards,

ojmv30
04-15-2007, 01:42 PM
Gracias por el post, se lo agradesco mucho.
Sorry, my english is not very good.

PE?AFIEL
08-13-2008, 02:41 PM
LO QUE TIENES FUNCIONA BIEN
TENGO OTRA SOLUCI?N, NOS? SI LE HE DADO MUCHA VUELTA PERO AHI VA
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayAlerts = True
End Sub
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
ActiveWorkbook.Save
Application.DisplayAlerts = False
End Sub

David