JB7调用EXCEL文件的问题?
我的源文件:
import java.lang.*;
import java.io.*;
public class LoadWinApp
{
public static void main(String args[]) throws IOException
{
Runtime r = Runtime.getRuntime();
Process p = null;
String strWinApp = "Execel.exe";
String strWinFile = "C:\\test.xls";
if(args.length > 0)
{
strWinFile = args[0];
}
try
{
p = r.exec(strWinApp + " " + strWinFile);
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
在JB7下运行出错:
java.io.IOException: CreateProcess: Execel.exe C:\Book1.xls error=2
为什么呢?