• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1514
  • Last Modified:

SendKeys in VB

I have the following code:

Dim ReturnValue, I
ReturnValue = Shell("calc.exe", 1)   ' Run Calculator.
AppActivate ReturnValue    ' Activate the Calculator.
SendKeys "{1}", True   ' Send keystrokes to Calculator1

When I run this code, I get the error message Runtime error '70' "Permission Denied"
0
deross
Asked:
deross
1 Solution
 
lorelogicCommented:
This seems to be related to the increased security that Microsoft has been implementing. Here are some links that might help:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=474685&SiteID=1
http://blogs.msdn.com/davbosch/commentrss.aspx?PostID=539470
0
 
Anthony2000Commented:
Are you using Vista? I tried your code under Windows XP and it ran okay. I am logged in as an admin.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now