Solved

Sendkeys does not work in Windows 7 using VB6

Posted on 2013-01-23
3
10,012 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel VBA, find a string in a column, update a cell 7 78
Visual Studio search word table and return Cell index 8 61
MsgBox 4 59
Formula problem with Excel attachment 6 27
This article will show, step by step, how to integrate R code into a R Sweave document
The purpose of this article is to demonstrate how we can use conditional statements using Python.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

776 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