| 
    
     |  | ブックを閉じる時に保存する場合の考慮が不足してますね。 (ブックが開き直されちゃいますね。)
 失礼しました。
 BeforeCloseイベントにも考慮が必要です。
 
 Private Sub Workbook_BeforeClose(Cancel As Boolean)
 Dim ret As VbMsgBoxResult
 Dim sh As Object
 If Not Me.Saved Then
 ret = MsgBox("'" & Me.Name & "' への変更を保存しますか?", _
 vbYesNoCancel + vbExclamation)
 Select Case ret
 Case vbYes
 For Each sh In Me.Sheets
 If Not sh.ProtectContents Then
 sh.Protect cnsPathWd
 Else
 On Error Resume Next
 sh.Unprotect cnsPathWd
 sh.Protect cnsPathWd
 On Error GoTo 0
 End If
 Next
 Application.EnableEvents = False
 Me.Save
 Application.EnableEvents = True
 Case vbNo
 Me.Saved = True
 Case vbCancel
 Cancel = True
 Exit Sub
 End Select
 End If
 End Sub
 
 
 同じようなコードはまとめてプロシージャ化した方がいいかもしれません。
 
 
 |  |