How to execute Visual Basic from JAVA ? – part 1
July 9, 2009 Leave a comment
I’m facing a common programming problem. I’m on my windows machine and I have a software package which run fine form my needs but it is not available in JAVA… how to integrate it in my JAVA program ?
First there is connectors to run activeX of other microsoft tech from JAVA, my way is to use directly VB from JAVA with a shell command.
Everyone know that there is a visual basic embedded in microsoft office. So the strategy is to launch a word to make the VB code run…
To launch word, here the easy way :
String sCmd ;
sCmd = “notepad ” + “c:\\temp\\test.txt” ;
try {
Runtime.getRuntime().exec(sCmd);
} catch (IOException e) {
e.printStackTrace();
}
In our next article we will see how to start VB… greetings.