我正在使用JExcel API讀取Eclipse中的.xls文件。這裏是我的代碼:JExcel API中的Workbook.getWorkbook()錯誤
import jxl.*;
import java.io.File;
public class JExcelDemoClass
{
public static void main(String[] args)
{
try
{
Workbook wrk1=new Workbook.getWorkbook("C:\\Test.xls");
Sheet sheet1=wrk1.getSheet(0);
Cell col1row1=sheet1.getCell(0,0);
Cell col1row2=sheet1.getCell(0,1);
Cell col1row3=sheet1.getCell(0,2);
String get_col1row1=col1row1.getContents();
String get_col1row2=col1row2.getContents();
String get_col1row3=col1row3.getContents();
System.out.println(get_col1row1);
System.out.println(get_col1row2);
System.out.println(get_col1row3);
}
catch(Exception e)
{
System.out.println("Error");
}
}
}
當我嘗試運行這段代碼時,Eclipse讓我錯誤
Workbook.getWorkbook不能被解析爲一個類型
任何想法,爲什麼我收到此錯誤?
爲什麼我找不到'Workbook.getWorkbook'? 當我說工作簿。我反而得到一些像這樣的常量'Workbook.PICTURE_TYPE_JPEG' – Muddz