How To Run Fortran.exe using Excel

  • Fortran
  • Thread starter khazarhayat
  • Start date
  • #1

Main Question or Discussion Point

Hello everybody,

I have a fortran.exe (compiled using intel visual fortan comipler 10.1.24 and VS 2005) which takes an input.dat file and generates output.dat.

Currently, I am trying to control fortran.exe execution with excel 2010 shell function. But it is not working properly.

The Shell function syntax is correct, it does run fortran.exe and DOS window can be seen. But fortran.exe ends prematurely without generating output.dat file. However, In case of double-clicking fortran.exe, it runs and reads input.dat and generate output.dat properly.

I have spent several days on this problem. I have recompile program, relaxed excel-marco security setting etc, but in vain.There are similar posts on web describing such problem, but no one clearly described the solution.

Surprisingly, using same shell function i can successfully run a java.exe file.

Any kind of comments, suggestion, advice regarding above problem will be warmly welcomed.
 

Answers and Replies

  • #2
1,065
53
Disclaimer: don't use excel much, don't know VBA, don't do much DOS.

Debugging/testing ideas:
are all the files in the same directory? including the fortran exe?
is the command to start the fortran exe instructed to wait for it to finish?
google returned a few hints about calling fortran DLLs from excel, is this of no use to you?
 

Related Threads on How To Run Fortran.exe using Excel

Replies
1
Views
635
  • Last Post
Replies
2
Views
746
Replies
9
Views
906
  • Last Post
Replies
3
Views
17K
Replies
16
Views
969
Replies
1
Views
662
Replies
1
Views
6K
Replies
4
Views
2K
Replies
9
Views
2K
Top