Opening an fotran .exe file from Visual Basic

  • Thread starter jaap de vries
  • Start date
  • Tags
    File Visual
In summary, the conversation is about how to call a fortran .exe file from Visual Basic in order to combine computational efficiency with a graphical user interface. One suggestion is to use the Shell command in Visual Basic, but there is an issue with the .exe file not being able to read input from a file when opened through Visual Basic.
  • #1
jaap de vries
166
0
Opening a fortran .exe file from Visual Basic

Dear friends,

I want to do something that is probably not too hard, I just can't figure it out. I want to call a executable (.exe) file that I have written in Fortran from my visual basic code. Let's say push a button and it automatically runs my (.exe) program. This way I would combine computational efficiency with a nice graphical user interface.

Any suggestions?
 
Last edited:
Computer science news on Phys.org
  • #2
As far as i remember there was a command like:

Shell("c:\wherever\something.exe")
 
  • #3
Thanks this seems to work.
 
  • #4
Hi, I tried the shell command in visual basic and it works, but the problem is the something.exe file is not able to read the input from a file. However when it is opened directly (ie not from visual basic, but from fortran compiler), it works fine. Can you help me?
 

1. Can a .exe file created in Fortran be opened in Visual Basic?

Yes, it is possible to open a .exe file created in Fortran in Visual Basic. However, the compatibility may depend on the version of Fortran and Visual Basic being used.

2. How do I open a .exe file in Visual Basic?

To open a .exe file in Visual Basic, you can use the Shell function to run the .exe file. The syntax for using the Shell function is: Shell(pathname, windowstyle)

3. Can I pass arguments to the .exe file when opening it in Visual Basic?

Yes, it is possible to pass arguments to the .exe file when opening it in Visual Basic. You can use the Shell function with the appropriate arguments to pass the necessary inputs to the .exe file.

4. Are there any specific libraries or dependencies required to open a .exe file in Visual Basic?

No, there are no specific libraries or dependencies required to open a .exe file in Visual Basic. However, if the .exe file was created using external libraries, those may need to be included in the Visual Basic project for it to run properly.

5. Can I use Visual Basic to edit or modify the .exe file created in Fortran?

No, Visual Basic is not a suitable tool for editing or modifying a .exe file created in Fortran. You will need to use a Fortran compiler or editor to make any changes to the .exe file.

Similar threads

Replies
15
Views
5K
  • Programming and Computer Science
Replies
29
Views
2K
  • Programming and Computer Science
Replies
0
Views
229
  • Computing and Technology
Replies
3
Views
2K
  • Programming and Computer Science
Replies
1
Views
523
  • Programming and Computer Science
Replies
1
Views
250
  • Computing and Technology
Replies
16
Views
6K
  • Computing and Technology
Replies
14
Views
6K
  • Programming and Computer Science
Replies
2
Views
911
  • Computing and Technology
Replies
2
Views
6K
Back
Top