How to determine the file location in Fortran called from vba excel

95 views Asked by At

I have an Excel Macro calling an *.exe file created in Fortran. The Fortran code contains OPEN(UNIT=1, FILE="T13579.txt"...). When the *.exe file runs directly there is no problems. When the file is called from Macro, it cannot find the file. I tried both

ABC = Shell(myPath & "\OFE.exe", 1)
Call Shell(myPath & "\OFE.exe", 1)

(All files are in the same directory:

myPath = Application.ActiveWorkbook.Path)
0

There are 0 answers