ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   disable ctrl+s (https://www.excelbanter.com/excel-programming/272550-disable-ctrl-s.html)

susie

disable ctrl+s
 
My excel application needs to disable short cut key ctrl+s.
Is there a function that allow me to disable the short cut
key so that my user will not allowed to use the short cut
key when they are not suppose to save the file to the
wrong folder.

Thanks.

steve

disable ctrl+s
 
Susie,

You could disable any save by putting the below code in the ThisWorkbook
module. The msg part allows saving if the user knows the password.

steve

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Dim msg As String

msg = InputBox("Enter password to save")

If msg = "pswrd" Then
Exit Sub
Else
Cancel = True
End If

End Sub


"John Michl" wrote in message
...
One quick way would be to record a macro that does nothing and assign it

to
ctrl-s. For instance, start the macro recorder, assign a name of DisableS
and a shortcut of Ctrl-s. While it is recording do something simple like
click on any cell, then stop the recorder. Edit the macro and eliminate

or
comment out any code between the Sub and End Sub statements so that code
looks something like the following. You might want to put a message box

in
so that users get a brief message saying that Ctrl-s is diabled.

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 7/24/2003 by John A. Michl
'
' Keyboard Shortcut: Ctrl+s
'
' Sheets(Sheet1).Range("A1").Select

MsgBox("Please note Ctrl-s is disabled.)

End Sub

Hope that helps.

- John Michl


"susie" wrote in message
...
My excel application needs to disable short cut key ctrl+s.
Is there a function that allow me to disable the short cut
key so that my user will not allowed to use the short cut
key when they are not suppose to save the file to the
wrong folder.

Thanks.







All times are GMT +1. The time now is 07:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com