用jxl修改excel,程序运行后打开excel文档,总是提示“不能读取文件”,附小段程序,求救
package yuebao;
import java.io.*;
import jxl.*;
public class CallRecord2
{
public static void main(String[] args)
{
try
{
jxl.write.WritableWorkbook rwb = Workbook.createWorkbook(new File( "2007-6-28.xls "));
jxl.write.WritableSheet rs = rwb.getSheet(0);
jxl.write.Label labelC = new jxl.write.Label(1, 1, "This is a Label cell ");
rs.addCell(labelC);
rwb.write();
rwb.close();
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
------解决方案--------------------路径不对?文件格式?
------解决方案--------------------错误信息呢。。。。估计是文件所在的路径问题吧
------解决方案--------------------你的Workbook类哪里来的?