SendKeys in VB

Posted on 2007-07-29
Last Modified: 2007-12-19
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"
Question by:deross
    LVL 3

    Accepted Solution

    This seems to be related to the increased security that Microsoft has been implementing. Here are some links that might help:
    LVL 8

    Expert Comment

    Are you using Vista? I tried your code under Windows XP and it ran okay. I am logged in as an admin.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
    I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    761 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

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now