How to execute Visual Basic from JAVA ? – part 1


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.

Advertisements

About pierrekoerber
Hey, pour faire connaissance, laisse-moi un message... drop me a line.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: