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"
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:
Are you using Vista? I tried your code under Windows XP and it ran okay. I am logged in as an admin.
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.