M8 Sendkeys Replacement for Visual Basic

Visual Basic's Sendkeys statement does not work under Windows Vista. The only way that Visual Basic programers can send keys under Vista is to use the Windows API, SendInput function and that can mean a huge amount of re-coding in applications originally written using the VB Sendkeys statement. Fortunately, M8 can provide a much easier solution.

Keysend.bas is a module which wraps SendInput into a new sub Sendkey. Sendkey is a direct replacement for the VB Sendkeys. To use it, all you have to do is add the module to your project then replace "Sendkeys" with "Sendkey" in your code. Sendkey interprets all Sendkeys parameters without modification.

In addition to fixing Sendkeys problems under Vista, Sendkey also includes the following features not available in the VB Sendkeys:

1. It can send the PrtScr key
2. You can specify that numbers are from the numeric keypad
3. You can set the state of the capslock, numlock and scrollock keys
4. You can send keys between applications which use different keyboard layouts.

Download Demo

The demo is a compiled program which allows you to test Sendkey and compare the results with the old VB Sendkeys.

The send buttons send to whichever window had the focus immediately before they were clicked, so you can test send to any application.

VB.NET Users please note: The downloadable demo uses the VB5/6 version. The Dot.Net version does not work under Win7 64 bit.

Sendkey is supplied in 3 formats:
   1. A VB code module for VB5, VB6 or VBA
   2. A VB code module for Visual Basic Dot Net
   3. An executable for all other programming languages (Details)

Buy Now

Known problems and solutions

How to send keys to the last used application

Read Keysend.bas Developer Notes

Sendkey Syntax

Version History