title: How to write data in multiple cells in Excel using java?
body: <p>I wrote a code for writing data in an Excel sheet.In this i have to write the data in multiple cells.But it is showing some Errors.For one cell it is able to change the data.I kept <strong>for loop</strong> for changing the data in multiple cells.For this it is showing Error.
  Can any one tell me that where i did mistake.</p>
  
  <pre><code>import java.io.*;
  import java.text.SimpleDateFormat;
  import java.util.Calendar;
  import java.util.Iterator;
  import java.util.List;
  import java.util.Vector;
  import java.lang.String;
  
  import javax.swing.JOptionPane;
  
  import jxl.Cell;
  
  import org.apache.poi.hssf.util.CellReference;
  import org.apache.poi.ss.formula.functions.Column;
  import org.apache.poi.ss.usermodel.Row;
  import org.apache.poi.xssf.usermodel.XSSFCell;
  import org.apache.poi.xssf.usermodel.XSSFComment;
  import org.apache.poi.xssf.usermodel.XSSFRow;
  import org.apache.poi.xssf.usermodel.XSSFSheet;
  import org.apache.poi.xssf.usermodel.XSSFWorkbook;
  
  
  public class Sele1
  {
  
      public static void main(String[] args)
      {
          // TODO Auto-generated method stub
          String FileName = "C:\\Users\\u304081\\Desktop\\Java\\new.xlsx";
  
          try 
          {
              FileInputStream fileInputStream3 = new FileInputStream(FileName);
              File outputsheetfile1 = new File(FileName);
              if(outputsheetfile1.exists()) 
              {
                  System.out.println("File existed");
                  try
                  {
                      XSSFWorkbook ObjWorkBook = new XSSFWorkbook(fileInputStream3);
                      XSSFSheet DriverTableSheet = ObjWorkBook.getSheetAt(0);
                      for(int i=1;i&lt;3;i++)
                      {
                      XSSFRow row1 = DriverTableSheet.getRow(i);
                      XSSFCell Cell1 = row1.getCell(0);
  
                      System.out.println("Cell1"+ Cell1);
                      //System.out.println("Cell2"+ Cell2);
                       String str = "Abc";
                       Cell1.setCellValue(str);
  
                       FileOutputStream out1 = new FileOutputStream (FileName,false);
                       ObjWorkBook.write(out1);
                       fileInputStream3.close();
                      }
  
                  } 
              catch (IOException e) 
              {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              }
  
              }
          } catch (FileNotFoundException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
          }
      }
  </code></pre>
  
  <p><strong>Error I am getting is:</strong></p>
  
  <pre><code>ObjWorkBook.write(out1);
  
  `"poi-bin-3.9-20121203\poi-3.9\poi-ooxml-3.9-20121203.jar has no source attachment"`
  </code></pre>