G
Gabriele C
HI!
i'm having troubles with activeworkbook.save
I have a button that calls "closewb"macro
If I use this button,the file is closed WITHOUT saving anything
If I close by rightclick-close,or with the x in the topright corner, i
saves.Why?
I will be happy If anyone helps
Sub closewb()
ActiveWorkbook.Close
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Worksheets(1).Select
If Range("c2").Value = "EFFETTIVO" Or Range("f50").Value = "annulla
Then
ActiveWorkbook.Saved = True
Else: ActiveWorkbook.Save
End If
End Su
i'm having troubles with activeworkbook.save
I have a button that calls "closewb"macro
If I use this button,the file is closed WITHOUT saving anything
If I close by rightclick-close,or with the x in the topright corner, i
saves.Why?
I will be happy If anyone helps
Sub closewb()
ActiveWorkbook.Close
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Worksheets(1).Select
If Range("c2").Value = "EFFETTIVO" Or Range("f50").Value = "annulla
Then
ActiveWorkbook.Saved = True
Else: ActiveWorkbook.Save
End If
End Su