VB.NET, Call an executable with parameter by a macro
-
08-07-2019 - |
Question
I have an application that used Macro.
In this macro I would like to call an external executable like this:
SYSTEM( "C:\Programme\Transform.exe" ,
"C:\Programme\Vectors.txt" ,
"C:\Programme\Vectors_Compensate.txt",
"C:\Programme\Vectors_Final.txt" )
This executable reconstruct a modified file according to a template file. Finally, a new file is create.
Transform.exe open a form that ask the Path for - Template File - Modified file - where you want to put the new reconstruct file.
After this you press start.
I would like that when you call that command line
SYSTEM( "C:\Programme\Transform.exe" ,
"C:\Programme\Vectors.txt" ,
"C:\Programme\Vectors_Compensate.txt",
"C:\Programme\Vectors_Final.txt" )
The parameter will go in the place in the form.
How can I do that ???
Thanks.
Solution
enter code here
I found it :
Dim cmdLine As String
Dim Parms() As String ' if the paramters are strings - declare this as necessary
cmdLine = Command$() ' Command$ would return "Parms1 Parms2 Parms3"
Parms = Split(cmdLine, " ")
'This section filled the form textbox.
TextBoxTemplate.Text = Parms(0)
TextBoxModify.Text = Parms(1)
TextBoxFinal.Text = Parms(2)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow