Easy Solution of SendKeys() Permission Denied Error in VB6.0

Sendkeys() basically work for any key press or combination of key press from keyboard. But it present error during running process. SKOTechLearn describe the tips to easy solution of SendKeys() permission denied error in VB6.0.

If you want to perform any shortcut key like: (ctrl+F, ctrl+G, ctrl+N, Enter, TAB etc.) through any VB’s controls then use SendKeys() in VB6.0 application. But, when we are working in Windows edition with Windows7, 8, 10 or Vista. Then we have to face problem of "Access denied".

Add data in Listview dynamically in VB6.0

You are always thinking that there were some coding problem, but when checking other site for code, we find that there is no coding problem. So, what is the problem being occurred during process on this code at run time.

SendKeys() code with error output:

There is code we run on VB6.0 application.

Private Sub Text1_GotFocus()

     SendKeys ("%{TAB}")

End Sub

After this code process, the running application will present the error message like bellow.

Sendkeys() permissdion denied Error output
Error output
In this post, we provide step by step solution of "Access denied" problem in this process.
Follow given bellow steps.


SendKeys() Permission Denied Error Solution :

If you face permission denied error problem in SendKeys() and get rid of it, then follow the steps given following:

Step 1: Open Control Panel

1.
First, go to “Start” Menu from left bottom of Windows and then find “Control Panel”.

2.
From “Control Panel” find “User Accounts”. Other way to find “User Accounts”, just type 'User Accounts' in “Start” menu search bar and click on it.

Design Login form with MSAccess connection through ADODC in vb6.0

Start >> Control Panel >> User Accounts
Control panel and User Accounts for sendkeys error
Open Control panel and User Accounts

Step 2: Open User Account Settings

3.
"User Accounts" screen will show. In this screen, find "Change User Account Control settings" and click on it.

4.
After clicking on this option, an another screen "User Account Control Settings" will show for setting user account. This screen will help to protect from harmful programs which are making changes to your computer. But, we have to changes for error solution.

Selected record edit or delete from MSHFlexGrid

User Account control settings for sendkeys() error
User Account control settings

Step 3: User Account Control Settings
In above given picture, setting some changes in Account Control Settings.

5.
This screen has a "Slider", with 2 labels ‘Always notify’ in upper side and ‘Never notify’ in lower side.

6.
down "Slider" like mention above, then press "OK" button.

7.
After apply these settings. It is necessary to Restart computer. After restarting system, the all system settings will be change.

8.
Now, open Visual Basic application and once again run application. This time it will not showing any error message of "Access denied".

Change Grid Style of MSHFlexGrid in Visual Basic 6.0

If you create a setup file of application and install or run application to another system. Then you have to apply same setting on another computer. Because every system require control's setting for this key process.

But if there is some other issue like: SendKeys() is not working on given key.

You have to check code. If key code will not written in proper way, it will not showing according output.

SendKeys() Code Instructions with Some Example you have to put on code:

For particular single key process

Use " (inverted comma)
Use { (curly brase)
eg.: SendKeys("{ENTER}")

For combination of key process

Combination of key cannot complete without Ctrl, Alt, Shift key. but in some case this is not require. Apply these key as:

Ctrl = ^
Alt = %
Shift = +

Apply given key for (ctrl + v).
eg. SendKeys (“^v”)

Other combination key example:
eg. SendKeys("{HOME}+{END}")

This is the easy Solution of SendKeys() Error in visual basic 6.0.

Some easy programming tips.

Create folders or Directories and Copy files through CMD


4 comments:

  1. Not working In windows 10 after UAC set to never notify

    ReplyDelete
    Replies
    1. After UAC setting, have you restarted your system. Tell me the error msg.

      Delete