Run another software program programmatically?

Hap

Well-known Member
Joined
Jul 20, 2005
Messages
647
The USGS has a .jar program used to provide earthquake hazard data giving lat and long coordinates. The program also has an option to import and export an .xls batch file.

Is it "possible" to programmatically open, run, send a batch file, return the batch file, and close the program all in VBA?

Thank you
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
The program uses the values to from the program but 99% of the program I'm writing isn't about running java programs. A fair question though!!
 
Upvote 0
I'll check into that. You know any good sample code or related threads?

Thanks
 
Upvote 0
If you're shelling to an external program and you want your VBA code to wait until it finishes before proceeding, do a Google search for shellwait.
 
Upvote 0
Ok. I can get the other program to run but is there a way to pass parameters to it? Also on the wait functionality, can I just include a msgbox driven wait before continuing rather than being tied to the execution or state of the other program?

Thanks again
 
Upvote 0
Ok. I can get the other program to run but is there a way to pass parameters to it?
Whether you can pass parameters to it depends on whether it accepts them. How would you pass them if you were calling it from the command line?

Also on the wait functionality, can I just include a msgbox driven wait before continuing rather than being tied to the execution or state of the other program?
I'm not sure why you'd want to do it that way but yes, that will work.
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,833
Members
452,947
Latest member
Gerry_F

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top