Anyone able to suggest why the following code does not result in an updated copy of the workbook being saved. The entries in cells A1 and A2 are not present when the file is re-opened.
Sub SaveAndClose()
Dim wbThis As Workbook
Set wbThis = ActiveWorkbook
OK = False
On Error GoTo NotAbleToSave
With wbThis
Application.StatusBar = "Saving . . . "
.Save
Cells(1, 1) = wbThis.Name
Cells(2, 1) = wbThis.Saved
OK = True
End With
NotAbleToSave:
Application.StatusBar = False
If Not OK Then
MsgBox "Backup Copy Not Saved!", vbExclamation, ThisWorkbook.Name
End If
wbThis.Saved = True
Application.Quit
End Sub
Thanks
Duncan
Bookmarks