chetanojha
New Member
- Joined
- May 3, 2016
- Messages
- 20
Hi,
I have an excel column in which I have created java command (using formulas etc based on other columns).
There are more than one cells in the columns with respective Java command.
I want to run them in loop so that when Java command execute it will create some files for me.
I just want to find out how to run the command in loop based on the values in the cell. The cell in the excel look like below:
Name of the column is "Java Command"
[TABLE="class: grid, width: 600, align: left"]
<tbody>[TR]
[TD]Java Command[/TD]
[/TR]
[TR]
[TD]java -jar ABC.jar -t oca -p -o "LONDON" -cpu 02 -u ROLLNUMBER1 -x -z[/TD]
[/TR]
[TR]
[TD]java -jar ABC.jar -t oca -p -o "AMSTERDAM" -cpu 02 -u ROLLNUMBER2 -x -z[/TD]
[/TR]
[TR]
[TD]java -jar ABC.jar -t oca -p -o "NEWYORK" -cpu 02 -u ROLLNUMBER3 -x -z[/TD]
[/TR]
[TR]
[TD]java -jar ABC.jar -t oca -p -o "EDINBURGH" -cpu 02 -u ROLLNUMBER4 -x -z[/TD]
[/TR]
</tbody>[/TABLE]
Now on this very forum I found a code to run the java program from the excel. But i am not not sure how to run it in the loop:
File ABC.jar is present in the same directory as this excel sheet.
Can anybody advice how can i run all the above Java command in loop at the click of the button?
Thanks
I have an excel column in which I have created java command (using formulas etc based on other columns).
There are more than one cells in the columns with respective Java command.
I want to run them in loop so that when Java command execute it will create some files for me.
I just want to find out how to run the command in loop based on the values in the cell. The cell in the excel look like below:
Name of the column is "Java Command"
[TABLE="class: grid, width: 600, align: left"]
<tbody>[TR]
[TD]Java Command[/TD]
[/TR]
[TR]
[TD]java -jar ABC.jar -t oca -p -o "LONDON" -cpu 02 -u ROLLNUMBER1 -x -z[/TD]
[/TR]
[TR]
[TD]java -jar ABC.jar -t oca -p -o "AMSTERDAM" -cpu 02 -u ROLLNUMBER2 -x -z[/TD]
[/TR]
[TR]
[TD]java -jar ABC.jar -t oca -p -o "NEWYORK" -cpu 02 -u ROLLNUMBER3 -x -z[/TD]
[/TR]
[TR]
[TD]java -jar ABC.jar -t oca -p -o "EDINBURGH" -cpu 02 -u ROLLNUMBER4 -x -z[/TD]
[/TR]
</tbody>[/TABLE]
Now on this very forum I found a code to run the java program from the excel. But i am not not sure how to run it in the loop:
Code:
Private Sub CommandButton1_Click()
ChDir ThisWorkbook.Path
Shell "java -jar ABC.jar -t oca -p -o "LONDON" -cpu 02 -u ROLLNUMBER1 -x -z"
End Sub
File ABC.jar is present in the same directory as this excel sheet.
Can anybody advice how can i run all the above Java command in loop at the click of the button?
Thanks