MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

VBA Code to enable switching between applications

  Asked By: Vernon    Date: Dec 16    Category: MS Office    Views: 3054

I'm an older Excel fan always learning more and more about the great
ways VBA expands Excel's capabilities.

But I've come to a fork in the road where I need to ask your advice
or guidance to hopefully resolve a small but perplexing problem.

I have two applications open:
One is Excel & the other is TradeStation 8.1

My VBA procedures in Excel work really well. They sure are are a lot
easier to work with than TradeStation's "Easy Language" coding

What I'm trying to accomplish is to build an OnTime event that will
allow me to will gather quote data from my Tradestation Quote window
on a regular interval basis.

I understand how to build the OnTime events, but I'm at a dead end
trying to figure out if there is any VBA code that would enable an
Alt+Tab switch from Excel to TradeStation's open Quote window and
then after a simple "select all" and "copy cells" (from the
tradeStation menu bar), enable another Alt+tab switch back to the
open Excel sheet allowing me to paste the clipboard cells to
the "still" selected ActiveCell.

The actions that I need to automate are as follows::

In Excel:
Application.Goto Reference:="External_Market_Data_Import_Home"

Then what I'm stumped with is how to code
__________ Alt+Tab switch to the Tradestation Quote Page
Cells.Select Ctrl+A Select All
Selection.Copy Ctrl+C Copy the Selected cells
__________ Alt+Tab switch back to Excel (last ActiveCell)
ActiveSheet.Paste Ctrl+V paste the data into Excel

Can VBA accomplish these switching actions?
Or am I at a dead end here?



1 Answer Found

Answer #1    Answered By: Della Simpson     Answered On: Dec 16

This information may or may not be helpful to you.

First of all, since I am unfamiliar with your product Tradestation, I
don't know whether you can address the Tradestation object in this
manner or not, I guess it will depend on whether it understands VBA or

Here is more information about using the clipboard:
http://www.cpearson.com/excel/clipboar.htm &

If you can not address TradeStation as an object, then you may need to
use the FileSystemObject (FSO) to get it open
http://www.tutorial-web.com/asp/fso/ and then use clipboard  API calls:

Unless someone else has a better idea?

Didn't find what you were looking for? Find more on VBA Code to enable switching between applications Or get search suggestion and latest updates.