![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Location: Chatsworth, CA
Posts: 2
|
I am a real amateur on VBA for excel.
What I am doing is: I have put together an "Excel front end" for an older DOS application. My VBA script builds the input file for the app. Then I want to do something like: Shell "app_name < input_name" I've done this before (for another application) and it worked. Only this time, the app was written to require two input file names on separate lines of input. It's an old Fortran app, which wants the user to type two file names (input and output). The strange thing is, that if I type the line above (app_name < input_name) in a Dos window (I'm running XT) it works. If Excel VBA tries to shell out to do it, it simply returns and does not execute the program! The "input_name" file contains two lines, namely the file name of the input file and the file name of the output file, on different lines of text. Any suggestions? Thanks-- |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Columbus, OH, USA
Posts: 3,519
|
My suggestion for this is to write a *.bat file and execute it, here's some crappy code (I wrote it 3 years ago) that will write a batch (*.bat) file):
Open BatchFile For Output As #1 Notes: "sSelect" is a string variable that is analogous to your Input file. "BatchFile" is a string Variable that contains the complete path of a Batch file to write. e.g. "C:TempMyBatchFile.bat" "Process.ProcessName" is a string that in this case was analogous to your Output file (because I'm telling the program to "ex" the input file) I eventually ran the file using Shell like this (WinNT): Shell "cmd /C FartyFartFart < " & BatchFile "FartyFartFart" was the DOS name of the executable, then I told it to run the batch file (BatchFile). Any questions, just repost. (I've changed some names to protect the innocent, actually me because I did this for a client) |
|
|
|
|
|
#3 |
|
New Member
Join Date: Apr 2002
Location: Chatsworth, CA
Posts: 2
|
Thanks--I will try it Monday.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|