Re: Executing vbscript
lionelv@gmail.com wrote:
I need to manipulate excel spreadsheets. Can I do that with scripting
API in Java 6? Aside from that, the minimum requirements for the user
is Java 5. I didn't take this decision lightly. I was hacking out the
excel xml files by hand at one stage but it just proved to be to much
work and too fragile for when M$ changes their xml format (you know it
will happen :)).
<OT>
Are you talking about MS's "Office Open XML" format? The last I heard,
that was denied an ISO standard (something about being poorly
documented, too long, and impossible to understand, I think).
</OT>
I know that there are APIs to work with the old formats of Excel
spreadsheets, and there might be some headway into working with the
newer one. What prevents you from converting the VB script into Java and
using those APIs?
If executing the VBscript is important, it might be better to use a JNI
bridge to execute the Windows API to execute the VBscript directly as
opposed to running through cmd.exe (which doesn't exactly do what you
want, AFAIK). Even better would be to directly execute a VBscript
interpreter (there is probably an executable somewhere in
C:\WINNT\system32 that does that).
--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth