Does'nt Crash for me. The code works fine if u comment "row1.createCell((short)1).setCellValue("abc");" Probably something wrong with your file. Delete that file and try running again
- Ankit -----Original Message----- From: Sushama [mailto:[EMAIL PROTECTED] Sent: Thursday, August 04, 2005 9:47 AM To: poi-user@jakarta.apache.org Subject: Setting String value in cell Hi, I am trying to set "$CHEMSCAPE 1.0.0 0 2" value in the second cell of first row. I have written following code which creats the excel file.But when I open the file the excel crashes.Can anyone explain me the same? I have tried to set this value as a String explicitly but even that dosent work. I want to set this string to get ISIS support for interpretation of data in excel file. I have MDL ISIS installed on my machine. public class TestISIS { public static void main(String[] args) { try { HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet1 = wb.createSheet("sheet"); HSSFRow row0 = sheet1.createRow((short)0); row0.createCell((short)1).setCellValue("$CHEMSCAPE 1.0.0 0 2"); /* HSSFCell cell = row0.createCell((short)1); cell.setCellType(HSSFCell.CELL_TYPE_STRING); cell.setCellValue("$CHEMSCAPE");*/ row1.createCell((short)1).setCellValue("abc"); // Write the output to a file FileOutputStream fileOut = new FileOutputStream ("C:\\TestISIS.xls"); wb.write(fileOut); fileOut.close(); // if not closed then file is not created }catch(Exception e) { System.out.println("Exception "+e); } } } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/ --------------------------------------------------------------------------------------------------------- This e-mail message may contain privileged and/or confidential information, and is intended to be received only by persons entitled to receive such information. If you have received this e-mail in error, please notify the sender immediately. Please delete it and all attachments from any servers, hard drives or any other media. Other use of this e-mail by you is strictly prohibited. All e-mails and attachments sent and received are subject to monitoring, reading and archival by Monsanto. The recipient of this e-mail is solely responsible for checking for the presence of "Viruses" or other "Malware". Monsanto accepts no liability for any damage caused by any such code transmitted by or accompanying this e-mail or any attachment. --------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/