I am not following some of your comments, as regardless of how the message box is dismissed, the remaining statements should execute. For starters, rather than having EDate coerce a string into a date, maybe DateSerial.
Not Tested...
Sub Workbook_Open()
Dim Edate As Date
Edate = DateSerial(2016, 10, 27) 'replaced yesterdays date
If Date > Edate Then
MsgBox "This worksheet was valid upto " & Format(Edate, "dd-mmm-yyyy") & " and will be closed"
ThisWorkbook.Saved = True
ThisWorkbook.Close False
Exit Sub
End If
If Edate - Date < 3 Then
MsgBox ("This worksheet expires on " & Format(Edate, "dd-mmm-yyyy") & " You have " & Edate - Date & " Days left ")
End If
End Sub