Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SendKeys Action

Status
Not open for further replies.

DrBowes

Programmer
Jul 16, 2003
150
GB

1) I want to send Ctrl Alt and Delete then "W" to lock the workstation in an Excel Macro using the SendKeys action.

However this does not work as it sends the keys to Excel and not the machine.

Anyone know any ways around this?

2) It is possible to get any symbol by pressing Alt and three numbers on the numeric keypad. However this cannot be created using Sendkeys. I think the reason for this is that it has to be three keys on the numeric keypad and not the keys at the top of the main keyboard.

Anyone know how you can send the numeric keypad keys and not just the numbers?



 
I have a different approach, which works for Windows 2000
and Windows NT. Just use the following VBA code:

ReturnValue = Shell("c:\winnt\System32\rundll32.exe user32.dll,LockWorkStation", 0)

This will execute a Windows program which locks the system.

- vbMax



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top