Reputation: 23
I have a sample C# console application which consists of an .exe file. I need to open this file using Visual Basic 6 in order to pass parameters. How can I do it?
Upvotes: 2
Views: 2291
Reputation: 386
Use the VBA Shell
command.
Example:
Shell """C:\Program Files\CSharpProgram\CSharpProgram.exe"" Parameter1 Parameter Second"
Double "double quotes" inside "double quotes" translate to single "double quotes" in VBA/VB6. Helps if you need to use paths with spaces.
The shell command is asynchronous by default.
Check out the Shell function reference at Microsoft Website:
https://msdn.microsoft.com/en-us/library/office/gg278437(v=office.15).aspx
Upvotes: 4