Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old April 22nd, 2005, 07:00 PM
Registered User
Join Date: Apr 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Controlling Applications from within Excel

I have a old Fortran based application where I calculate thermodynamic properties. It runs in a window, but is definitly not window complient (menu driven, but has short cuts like Ctl + Ins to copy, Shft + Ins to paste)
The interface/output from this application are text files
The only ouput is a Txt file - 265 pages long
The input files are also Txt files, where I change parameters to vary what will be calculated - after which I "run" the program and it generates the output text files

So I built a excel spreadsheet to pull the text files and convert them into spreadsheets -where I can analyse the data:)
I also wrote macros to take data from my Excell files and rewrite the input text files:)

I would like to go the next step, and get Excel to
Open this application
Open a specific file
Run the file
and close

 I realise I can use a hyperlink to start the application, but even when I register the input files with the application, the application starts without the input files..... so I think I have to magically control the application from with excel (someway)

Can anyone point in a direction to learn how to do this

Old April 25th, 2005, 07:49 AM
Authorized User
Join Date: Aug 2004
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts

Have a look at VBA 'Shell' and 'SendKeys' in Help. They contain an example using Calculator. We need to include Wait statements in the code to allow time for things to happen on screen because the code runs too fast otherwise.
eg. for 1 second code is
Wait Now +TimeValue("00:00:01")

Regards BrianB
Most problems occur from starting at the wrong place.
Use a cup of coffee to make Windows run faster.
It is easy until you know how.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Controlling Excel with VBS proverbs36 VBScript 0 March 30th, 2007 02:32 PM
Controlling Print Option for Excel rendered report nitachil BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 October 25th, 2004 07:34 PM
Serious Problems with Applications in Excel 2002 mike_tyrer Pro VB 6 0 September 23rd, 2004 08:28 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.