B
botcan
Hi experts!,
I have created a workbook with a macro (assigned o a button), which
saves the workbook under a different name when the macro button is
clicked based on the infromation entered by the end-user. Accordingly
I don't want the end-user to save that workbook under any other name
or before completely filing the information needed. The macro enables
saving only after all information is entered.
I have disabled all commands functions, bars etc. and shortcuts (such
as Ctr+S) to avoid end-user saving without cliciking the macro button.
All work fine except Close Button(X) of excel on the very up-right
corner of the screen and the ALT+F4 short-cut. On both cases excel
warns the end-user to save the workbook or not. I tried
"Application.DisplayAlerts = False" but it doesn't work at all
workbook-open or before close:
-------------------------------------------------------------------------------------
Private Sub Workbook_Open() ' I also tried before_close
'To disable all BuiltIn Command bars
Dim Cbar As CommandBar
For Each Cbar In Application.CommandBars
If Cbar.BuiltIn = True Then
Cbar.Enabled = False
End If
Next
Application.OnKey "^s", ""
Application.DisplayAlerts = False ' turns 'em off
End Sub
I have created a workbook with a macro (assigned o a button), which
saves the workbook under a different name when the macro button is
clicked based on the infromation entered by the end-user. Accordingly
I don't want the end-user to save that workbook under any other name
or before completely filing the information needed. The macro enables
saving only after all information is entered.
I have disabled all commands functions, bars etc. and shortcuts (such
as Ctr+S) to avoid end-user saving without cliciking the macro button.
All work fine except Close Button(X) of excel on the very up-right
corner of the screen and the ALT+F4 short-cut. On both cases excel
warns the end-user to save the workbook or not. I tried
"Application.DisplayAlerts = False" but it doesn't work at all
workbook-open or before close:
-------------------------------------------------------------------------------------
Private Sub Workbook_Open() ' I also tried before_close
'To disable all BuiltIn Command bars
Dim Cbar As CommandBar
For Each Cbar In Application.CommandBars
If Cbar.BuiltIn = True Then
Cbar.Enabled = False
End If
Next
Application.OnKey "^s", ""
Application.DisplayAlerts = False ' turns 'em off
End Sub