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"
derossAsked:
Who is Participating?
 
lorelogicConnect With a Mentor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.