Run a java program inside VBA macro function in Excel?

CarolOu

New Member
Joined
Nov 16, 2006
Messages
2
Hi,
I defined a Macro function with VBA in Excel. And inside this function, I also need to run a java program.
In "Command Prompt", I can type: "java PromA xx xx" to execute it. How could I do the same thing in Excel VBA function?
Thanks a lot!
 

Some videos you may like

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Joe Was

MrExcel MVP
Joined
Feb 19, 2002
Messages
7,539
'Run JAVA Program

ChDrive ("D:")
ChDir ("D:\Java\Automation Folder\bin")

Shell ("java YourProgramObjectNameHere")

'Wait for JAVA to load!

newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 2
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
 

CarolOu

New Member
Joined
Nov 16, 2006
Messages
2
Joe, Thanks so much! It is exactly what I want. I spent lot of time on that... Thanks again!
 

Watch MrExcel Video

Forum statistics

Threads
1,109,411
Messages
5,528,617
Members
409,828
Latest member
99DodgeRam

This Week's Hot Topics

  • Change military grades into rank
    Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
  • VBA COUNTIF SOLUTION
    Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
  • INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
    Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...
  • Auto-Create a monthly Sign in sheet for preschool students
    The image below is what each page looks like. Above is space for the "Child Name" "Month" "Class" School days are obviously Monday-Friday but...
  • VBA vlookup multiple results
    Hi folks, Hopefully someone out there can help. I have a list to vlookup which works (ish). the lookup only picks up the first instance of the...
  • Extract values for earliest/latest times
    I am trying to put together a formula to get the earliest start time, the latest end time from column A for each person in Column B-F without the...
Top