I assume that you talking about Excel.
How are the keys disabled? The normal way would be to use "OnKey", but CRTL
and ALT can only be specified in combination with other keys.
Let's assume that you have disabled the CTRL + TAB combination using
Sub TestDisableOnKey()
Application.OnKey "^{TAB}", ""
End Sub
You can enable it using
Sub TestEnableOnKey()
Application.OnKey "^{TAB}"
End Sub
More specifically, to ensure it is re-enabled when you close the workbook
add this procedure to "ThisWorkbook"
Private Sub Workbook_BeforeClose(Cancel As Boolean)
TestEnableOnKey
End Sub
You also need to consider what happens when a user moves to and from that
workbook to another. These procedures (again placed in "ThisWorkboo") will
only allow the keys to be disabled when your main workbook is active.
Private Sub Workbook_Activate()
TestDisableOnKey
End Sub
Private Sub Workbook_Deactivate()
TestEnableOnKey
End Sub
--
Regards
Andy Wiggins
www.BygSoftware.com
Home of "Save and BackUp",
"The Excel Auditor" and "Byg Tools for VBA"
"turk5555" wrote in message
...
I have an application that disables the CTRL and ALT key when a workbook
is open. The purpose is to prevent users from activitating a shortcut
key or hot key. I want to make sure that when I close the workbook
that the CTRL and ALT key work normally when I open a different
workbook or spreadsheet.
Would appreciate any help with this.
Thanks in advance.
Tommy
---
Message posted from http://www.ExcelForum.com/