Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7403395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:04:16+00:00 2026-05-29T05:04:16+00:00

I want to run a VBA script from Excel 2007 that can switch focus

  • 0

I want to run a VBA script from Excel 2007 that can switch focus to another active window (ALT+TAB) send commands to that window, and then return focus to Excel and continue to perform commands in the VBA.

For example:

Copy the contents of cell A1, focus onto an active Internet Explorer window, send the TAB key command, paste the copied data from A1, and then refocus back into Excel to continue the VBA script.

Is this possible? I couldn’t find the right information online and feel like it is possible to do this using Excel VBA.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T05:04:17+00:00Added an answer on May 29, 2026 at 5:04 am

    I ended up finding & using this software called AutoHotkey. It’s free & open source.

    It allows you to script macros using a proprietary syntax that’s pretty intuitive to use.

    The problem I wanted to solve was much easier to execute using AutoHotkey versus Excel VBA.

    The AutoHotkey code for the above pseudo-code:

    #space::
    ;Focus to Excel and copy contents of cell A1
    WinActivate Microsoft Excel - filename.xls
    Send {Ctrldown}{Home}{Ctrlup}
    Send ^c
    
    ;Focus to Internet Explorer, TAB to the first field, and paste clipboard data into it
    WinActivate Google - Windows Internet Explorer
    Send {Tab}
    Send ^v
    
    ;Focus back to Excel
    WinActivate Microsof Excel - filename.xls
    return
    

    It’s not worth going over the specifics of this syntax, but I just pasted it for demonstration purposes.

    The program allows for a whole lot more and is worth a closer look if you need to automate tasks that require special mouse & keyboard actions across multiple windows. Normal programming aspects such as variables & loops are supported too.

    There is also more general info about the program and it’s potential uses on WikiPedia

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to run a VBScript file from an Ant script. How can I
I want to run a background task that reads input from a TextReader and
I've got some old Excel VBA code where I want to run a task
I want from VBA to start/stop Track changes functionality in Excel. Searching thru the
I want run a script as follows: runner: ssh 'java program &' ssh 'java
I want to run a weekly batch process in an asp.net page. How can
I want to run javascript/Python/Ruby inside my application. I have an application that creates
I want to run an Apache on my local machine since I can only
I am trying to use Runtime exec() to run a vba script with arguements.
I need to write a script in VBA so that if column B has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.