Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default 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.





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a difference between CTRL+D and CTRL+" (quotation marks) AKMMS Excel Discussion (Misc queries) 2 March 22nd 10 07:43 PM
How to make Ctrl-C, ctrl-V work in Office 2007 hj Excel Discussion (Misc queries) 1 June 23rd 09 01:09 PM
Excel 2007: Ctrl+PgUp or Ctrl+PgDn with Protected Sheets DrDave Excel Discussion (Misc queries) 1 July 28th 08 04:12 AM
disable CTRL-pageup & pagedown Boss Excel Discussion (Misc queries) 4 January 8th 08 06:08 PM
Disable CTRL+D??? CMIConnie Excel Discussion (Misc queries) 0 February 9th 06 07:52 PM


All times are GMT +1. The time now is 02:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"