Solved

Sendkeys does not work in Windows 7 using VB6

Posted on 2013-01-23
3
10,172 Views
Last Modified: 2013-01-23
Hi guys,

I was working fine programming with VB6 in Windows XP but since I changed my computer to Windows 7 and try to run my application I get this Error: Run time error 70: Permission Denied, this happend when i use SENDKEYS from a textbox, the way i use it is this:

Private Sub txtNombre_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
        Case vbKeyDown, vbKeyReturn
            Sendkeys "{TAB}"
        Case vbKeyUp
            Sendkeys "+{TAB}"
    End Select
End Sub

Is there any way to fix this?

Thank you so much guys.
0
Comment
Question by:elm9999
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
eemit earned 350 total points
ID: 38811369
You must use SendInput API
Here is an example.
0
 

Author Comment

by:elm9999
ID: 38811472
Thank you eemit,

I'll use setfocus to the next textbox.
0
 
LVL 15

Expert Comment

by:eemit
ID: 38811652
- The tab order is the order in which a user moves focus from one control to another by pressing the TAB key.
- Tab order can be set in the Properties window using the TabIndex property.
- By turning off the TabStop property, you can make a control be passed over in the tab order of the form.
You don't need Sendkeys for that!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question