I've been having issues saving changes in my workbook as of late, and discovered that this bit of code seems to be faulty:
..for when I make changes to the workbook, and then just close it without saving manually, I get this message:Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim lngResp As Long If Not ThisWorkbook.Saved Then ThisWorkbook.Saved = True lngResp = MsgBox("Do you wish to save the workbook before closing?", vbYesNo) If lngResp = vbYes Then With ThisWorkbook .Save .Saved = True End With End If End If End Sub
..and upon choosing 'Yes', the workbook closes, but no changes are saved. What could the error be? I've attached a sample of my workbook below.Do you wish to save the workbook before closing?
And for reference purposes, here is where this code originated.
Bookmarks