Missing Return Statement
<p>I am Trying to read an Excel file using and finding the Start position for my another for loop.</p>

<p>This is my code.</p>

<pre><code>public static int CheckStartPosition(String filename,int Colno,String StartChar, int sheetno,int startpos) { 
 try {

 Workbook workbook = new Workbook();

 workbook.open(filename);

 Worksheet worksheet = workbook.getWorksheets().getSheet(sheetno);

 Cells cells=worksheet.getCells();

 int num=cells.getMaxDataRow();

 int num1=cells.getMaxDataColumn();

 int numofsheet= workbook.getNumberOfSheets();

 System.out.println(numofsheet);

 for (int n1=0;n1&lt;=num;n1++) {  
     Cell cell1=cells.getCell(n1,Colno);
     if(cell1.getValue()!=null) {

         String value =cell1.getValue().toString().toLowerCase();
         if(value.equals(StartChar)) {

         System.out.println( cell1.getValue());

         int S= cell1.getRowIndex();

         startpos=S+1;

         System.out.println(startpos);
         }
     }else{}
 } 
 workbook.save("C:\\Movies.xls",FileFormatType.EXCEL97TO2003);

 return startpos; 
 } catch (IOException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
 }
</code></pre>

<p>}</p>

<pre><code>:-  

CheckStartPosition(f1.xls, 0,"abc",2,0);
</code></pre>

<p><strong>How to return Startposition</strong></p>
