Excel: How to sort a range?
Hello, all. I have a bit of a problem.
I'm using Eclipse to make up a project which involves sorting a certain range in an excel file. I am using JXL and JExcel. I have this snippet:
import java.io.File;
import java.io.IOException;
import java.util.Locale;
import jxl.*;
import jxl.format.UnderlineStyle;
import jxl.write.Formula;
import jxl.write.Label;
import jxl.write.Number;
import jxl.write.WritableCellFormat;
import jxl.write.WritableFont;
import jxl.write.WritableSheet;
import jxl.write.WritableCell;
import jxl.write.WritableWorkbook;
import jxl.write.WriteException;
import jxl.write.biff.RowsExceededException;
import jxl.Cell;
import jxl.CellType;
import jxl.Sheet;
import jxl.Workbook;
import java.util.Date;
import jxl.read.biff.BiffException;
import com.jniwrapper.win32.jexcel.*;
public void sort (WritableSheet sheet) throws ExcelException{
Application application = new Application();
File xlsFile = new File("C:\\Workbook.xls");
Workbook workbook = application.openWorkbook(xlsFile, true, "password");
}
And then I get the error of "Type mismatch: Cannot convert Workbook to Workbook"
I am using the tutorial as shown in this page, but even if I do it word-by-word, I can't seem to get it right.
JExcel Programmer's Guide
A solution would be most appreciated.