Dear All,
I want to append data to a existing excel sheet. For this am using POI API and I have given the full path
of Jar file of this API into class path in envornment varaibles .
It is giving the following error
org.apache.poi.hssf.usermodel.HSSFSheet when I tried to run the code.
Please help in this..
Thanks in advance
Here I m giving my code. I am using Eclipse.On run it is giving thaterror ""Errorrg.apache.poi.hssf.usermodel.HSSFShee t" in console block. Please help me in this regard.
Thanks in advance.
import java.io.*; import java.util.*; import org.apache.poi.ss.usermodel.WorkbookFactory; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hslf.model.*; import org.apache.poi.hslf.exceptions.*; public class Testing { public Testing() { } public static void main(String[] args) throws IOException, InvalidRecordFormatException{ // TODO Auto-generated method stub try{ FileInputStream fstream = new FileInputStream("test.xls"); org.apache.poi.ss.usermodel.Workbook wb = (org.apache.poi.ss.usermodel.Workbook)WorkbookFact ory.create(fstream); Sheet sheet =(Sheet)wb.getSheetAt(1); Row row = (Row)((org.apache.poi.ss.usermodel.Sheet)sheet).ge tRow(375); Cell cell=row.createCell(0); cell.setCellValue(10); FileOutputStream fileout=new FileOutputStream("test.xls"); wb.write(fileout); fileout.close(); } catch (Exception e){//Catch exception if any System.err.println("Error: " + e.getMessage()); } } }