当我双击一个单元格以关闭Excel时,我可以取消保存更改提示;如何防止new code
覆盖它?
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Address(False, False) = "U1" Then
Cancel = True
Application.DisplayAlerts = False
Application.Quit
End If
End Sub
Private Sub Workbook_Open()
ThisWorkbook.Saved = True
With Application '<< New code
.CommandBars.ExecuteMso "MinimizeRibbon"
.DisplayFormulaBar = False
End With
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
With Application '<< New code
.CommandBars.ExecuteMso "MinimizeRibbon"
.DisplayFormulaBar = True
End With
End Sub