![forums.silverfrost.com Forum Index](templates/subSilver/images/logo_phpBB.gif) |
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
Notquitenewton
Joined: 25 May 2021 Posts: 20 Location: England, UK
|
Posted: Mon Feb 21, 2022 2:33 pm Post subject: Calling 64-bit Fortran routine from Excel problem |
|
|
Tried looking in the Forum...but no luck!
I'm using FTN95 V8.8 with 64-bit Excel and 32bit Excel on another machine.
I have Fortran routines called 'superposition.exe' which is a 32-bit version and 'superposition64.exe' a 64-bit routine. They both run perfectly through a command prompt window but not when I call the 64-bit program from VBA. It seems to be a function of the term waitOnReturn as the program hangs. 32-bit version is fine. While it's 'hanging', if I terminate the routine from Task Manager then it continues quite happily. I wondered if the waitOnReturn is causing the issue with a signal from FTN95 telling Excel it's finished.
Any help appreciated.
Short VBA code as follows...
If InStr(Application.OperatingSystem, "64-bit") Then
waitOnReturn = True
Application.ScreenUpdating = False
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run Chr(34) & mydir & "\superposition64.exe" & Chr(34), 0, _
waitOnReturn
Else
waitOnReturn = True
Application.ScreenUpdating = False
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run Chr(34) & mydir & "\superposition.exe" & Chr(34), 0, _
waitOnReturn
End If |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Notquitenewton
Joined: 25 May 2021 Posts: 20 Location: England, UK
|
Posted: Mon Feb 21, 2022 3:38 pm Post subject: Calling 64-bit Fortran routine from Excel problem |
|
|
Interesting update...changing the zero to 1 appears to work ok for the 64-bit version!
Changed
WshShell.Run Chr(34) & mydir & "\superposition64.exe" & Chr(34), 0, _
waitOnReturn
to
WshShell.Run Chr(34) & mydir & "\superposition64.exe" & Chr(34), 1, _
waitOnReturn
fixed it! I'm not sure I understand why but ho hum - success. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|