Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I copied the code, but when the message box comes up saying "CTRL+ALT+DEL is
disabled, try pressing CTRL+ALT+DEL now." I press it and it still works. I have tried running just the Disable_Ctrl_Alt_Del program below and still can't get it to work. Public Sub Disable_Ctrl_Alt_Del() 'Disables the Crtl+Alt+Del Dim AyW As Integer Dim TurFls As Boolean AwY = SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, TurFls, 0) End Sub "Bill Pfister" wrote: http://www.planet-source-code.com/vb...=1494&lngWId=1 "jutlaux" wrote: I have a excel workbook that is via VBA goes out to various 3rd party applications and gets data from them. The problem I have is that this is not instantaneous and even tough I have a progress bar showing things moving along the user will hit CTRL+ALT+DEL and end the task. This is not a problem for excel, but the other software applications seem to be getting "hung up" b/c the data transfer is not complete. Is there a way when this workbook is opened to disable the CTRL+ALT+DEL function? I have tried using: Application.OnKey "^%{DEL}", "NotAllowed" but nothing happens. I have even tried just looking for the CTRL + ALT Application.OnKey "^%", "NotAllowed" but with this I get run-time error 1004 and if I change it to Application.OnKey "^{%}", "NotAllowed" or Application.OnKey "%{^}", "NotAllowed" nothing happens |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here's a decent article that describes a couple methods:
http://msdn.microsoft.com/msdnmag/is...A/default.aspx If you're just looking to stop people from accessing the Task Manager through Ctrl-Alt-Del, use this registry setting (you can use vb/vba code to set the Reg Key): [HKCU\Software\Microsoft\Windows\CurrentVersion\Pol icies\System] "DisableTaskMgr"=dword:00000001 "jutlaux" wrote: I copied the code, but when the message box comes up saying "CTRL+ALT+DEL is disabled, try pressing CTRL+ALT+DEL now." I press it and it still works. I have tried running just the Disable_Ctrl_Alt_Del program below and still can't get it to work. Public Sub Disable_Ctrl_Alt_Del() 'Disables the Crtl+Alt+Del Dim AyW As Integer Dim TurFls As Boolean AwY = SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, TurFls, 0) End Sub "Bill Pfister" wrote: http://www.planet-source-code.com/vb...=1494&lngWId=1 "jutlaux" wrote: I have a excel workbook that is via VBA goes out to various 3rd party applications and gets data from them. The problem I have is that this is not instantaneous and even tough I have a progress bar showing things moving along the user will hit CTRL+ALT+DEL and end the task. This is not a problem for excel, but the other software applications seem to be getting "hung up" b/c the data transfer is not complete. Is there a way when this workbook is opened to disable the CTRL+ALT+DEL function? I have tried using: Application.OnKey "^%{DEL}", "NotAllowed" but nothing happens. I have even tried just looking for the CTRL + ALT Application.OnKey "^%", "NotAllowed" but with this I get run-time error 1004 and if I change it to Application.OnKey "^{%}", "NotAllowed" or Application.OnKey "%{^}", "NotAllowed" nothing happens |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry, I was being lazy - here's the code:
Option Explicit Const HKEY_LOCAL_MACHINE = &H80000002 Const HKEY_CURRENT_USER = &H80000001 Public Sub ToggleCAD() Dim lngUser As Long Dim blnDisableTaskMgr As Boolean Dim oReg As Object Dim strKeyPath As String Dim strValueName As String Dim dwValue As Long blnDisableTaskMgr = True blnDisableTaskMgr = False lngUser = HKEY_LOCAL_MACHINE lngUser = HKEY_CURRENT_USER Set oReg = GetObject("winmgmts:{impersonationLevel=impersonat e}!\\.\root\default:StdRegProv") strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Policie s\System\" strValueName = "DisableTaskMgr" oReg.DeleteValue lngUser, strKeyPath, strValueName dwValue = IIf(blnDisableTaskMgr, 1, 0) oReg.SetDWORDValue lngUser, strKeyPath, strValueName, dwValue End Sub "jutlaux" wrote: I copied the code, but when the message box comes up saying "CTRL+ALT+DEL is disabled, try pressing CTRL+ALT+DEL now." I press it and it still works. I have tried running just the Disable_Ctrl_Alt_Del program below and still can't get it to work. Public Sub Disable_Ctrl_Alt_Del() 'Disables the Crtl+Alt+Del Dim AyW As Integer Dim TurFls As Boolean AwY = SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, TurFls, 0) End Sub "Bill Pfister" wrote: http://www.planet-source-code.com/vb...=1494&lngWId=1 "jutlaux" wrote: I have a excel workbook that is via VBA goes out to various 3rd party applications and gets data from them. The problem I have is that this is not instantaneous and even tough I have a progress bar showing things moving along the user will hit CTRL+ALT+DEL and end the task. This is not a problem for excel, but the other software applications seem to be getting "hung up" b/c the data transfer is not complete. Is there a way when this workbook is opened to disable the CTRL+ALT+DEL function? I have tried using: Application.OnKey "^%{DEL}", "NotAllowed" but nothing happens. I have even tried just looking for the CTRL + ALT Application.OnKey "^%", "NotAllowed" but with this I get run-time error 1004 and if I change it to Application.OnKey "^{%}", "NotAllowed" or Application.OnKey "%{^}", "NotAllowed" nothing happens |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If I do this on workbook open I would like to reenable CTRL+ALT+DEL on close.
To do this would I just change the follwoing? strValueName = "EnableTaskMgr" "Bill Pfister" wrote: Sorry, I was being lazy - here's the code: Option Explicit Const HKEY_LOCAL_MACHINE = &H80000002 Const HKEY_CURRENT_USER = &H80000001 Public Sub ToggleCAD() Dim lngUser As Long Dim blnDisableTaskMgr As Boolean Dim oReg As Object Dim strKeyPath As String Dim strValueName As String Dim dwValue As Long blnDisableTaskMgr = True blnDisableTaskMgr = False lngUser = HKEY_LOCAL_MACHINE lngUser = HKEY_CURRENT_USER Set oReg = GetObject("winmgmts:{impersonationLevel=impersonat e}!\\.\root\default:StdRegProv") strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Policie s\System\" strValueName = "DisableTaskMgr" oReg.DeleteValue lngUser, strKeyPath, strValueName dwValue = IIf(blnDisableTaskMgr, 1, 0) oReg.SetDWORDValue lngUser, strKeyPath, strValueName, dwValue End Sub "jutlaux" wrote: I copied the code, but when the message box comes up saying "CTRL+ALT+DEL is disabled, try pressing CTRL+ALT+DEL now." I press it and it still works. I have tried running just the Disable_Ctrl_Alt_Del program below and still can't get it to work. Public Sub Disable_Ctrl_Alt_Del() 'Disables the Crtl+Alt+Del Dim AyW As Integer Dim TurFls As Boolean AwY = SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, TurFls, 0) End Sub "Bill Pfister" wrote: http://www.planet-source-code.com/vb...=1494&lngWId=1 "jutlaux" wrote: I have a excel workbook that is via VBA goes out to various 3rd party applications and gets data from them. The problem I have is that this is not instantaneous and even tough I have a progress bar showing things moving along the user will hit CTRL+ALT+DEL and end the task. This is not a problem for excel, but the other software applications seem to be getting "hung up" b/c the data transfer is not complete. Is there a way when this workbook is opened to disable the CTRL+ALT+DEL function? I have tried using: Application.OnKey "^%{DEL}", "NotAllowed" but nothing happens. I have even tried just looking for the CTRL + ALT Application.OnKey "^%", "NotAllowed" but with this I get run-time error 1004 and if I change it to Application.OnKey "^{%}", "NotAllowed" or Application.OnKey "%{^}", "NotAllowed" nothing happens |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Use this code then use the CAD_Disable and CAD_Enable subroutines to disable and enable Ctrl-Alt-Del, respectively. Option Explicit Const HKEY_LOCAL_MACHINE = &H80000002 Const HKEY_CURRENT_USER = &H80000001 Public Sub CAD_Disable() Call ToggleCAD(True, HKEY_LOCAL_MACHINE) Call ToggleCAD(True, HKEY_CURRENT_USER) End Sub Public Sub CAD_Enable() Call ToggleCAD(False, HKEY_LOCAL_MACHINE) Call ToggleCAD(False, HKEY_CURRENT_USER) End Sub Public Sub ToggleCAD(blnDisableTaskMgr As Boolean, lngUser As Long) Dim oReg As Object Dim strKeyPath As String Dim strValueName As String Dim dwValue As Long Set oReg = GetObject("winmgmts:{impersonationLevel=impersonat e}!\\.\root\default:StdRegProv") strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Policie s\System\" strValueName = "DisableTaskMgr" oReg.DeleteValue lngUser, strKeyPath, strValueName dwValue = IIf(blnDisableTaskMgr, 1, 0) oReg.SetDWORDValue lngUser, strKeyPath, strValueName, dwValue End Sub "jutlaux" wrote: If I do this on workbook open I would like to reenable CTRL+ALT+DEL on close. To do this would I just change the follwoing? strValueName = "EnableTaskMgr" "Bill Pfister" wrote: Sorry, I was being lazy - here's the code: Option Explicit Const HKEY_LOCAL_MACHINE = &H80000002 Const HKEY_CURRENT_USER = &H80000001 Public Sub ToggleCAD() Dim lngUser As Long Dim blnDisableTaskMgr As Boolean Dim oReg As Object Dim strKeyPath As String Dim strValueName As String Dim dwValue As Long blnDisableTaskMgr = True blnDisableTaskMgr = False lngUser = HKEY_LOCAL_MACHINE lngUser = HKEY_CURRENT_USER Set oReg = GetObject("winmgmts:{impersonationLevel=impersonat e}!\\.\root\default:StdRegProv") strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Policie s\System\" strValueName = "DisableTaskMgr" oReg.DeleteValue lngUser, strKeyPath, strValueName dwValue = IIf(blnDisableTaskMgr, 1, 0) oReg.SetDWORDValue lngUser, strKeyPath, strValueName, dwValue End Sub "jutlaux" wrote: I copied the code, but when the message box comes up saying "CTRL+ALT+DEL is disabled, try pressing CTRL+ALT+DEL now." I press it and it still works. I have tried running just the Disable_Ctrl_Alt_Del program below and still can't get it to work. Public Sub Disable_Ctrl_Alt_Del() 'Disables the Crtl+Alt+Del Dim AyW As Integer Dim TurFls As Boolean AwY = SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, TurFls, 0) End Sub "Bill Pfister" wrote: http://www.planet-source-code.com/vb...=1494&lngWId=1 "jutlaux" wrote: I have a excel workbook that is via VBA goes out to various 3rd party applications and gets data from them. The problem I have is that this is not instantaneous and even tough I have a progress bar showing things moving along the user will hit CTRL+ALT+DEL and end the task. This is not a problem for excel, but the other software applications seem to be getting "hung up" b/c the data transfer is not complete. Is there a way when this workbook is opened to disable the CTRL+ALT+DEL function? I have tried using: Application.OnKey "^%{DEL}", "NotAllowed" but nothing happens. I have even tried just looking for the CTRL + ALT Application.OnKey "^%", "NotAllowed" but with this I get run-time error 1004 and if I change it to Application.OnKey "^{%}", "NotAllowed" or Application.OnKey "%{^}", "NotAllowed" nothing happens |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Is there a difference between CTRL+D and CTRL+" (quotation marks) | Excel Discussion (Misc queries) | |||
How to make Ctrl-C, ctrl-V work in Office 2007 | Excel Discussion (Misc queries) | |||
Excel 2007: Ctrl+PgUp or Ctrl+PgDn with Protected Sheets | Excel Discussion (Misc queries) | |||
Redefining the Ctrl [ and Ctrl ]s short cut with OnKey? | Excel Programming | |||
Disabling Ctrl-PgUp and Ctrl-PgDn | Excel Programming |