spreadsheet cell style and merge cells

how can i style and merge cells without affects other sheets in spreadsheet

spreadsheet sheet=new spreadsheet();
CellRangeAddress s=new CellRangeAddress(start_row,start_row ,start_col ,end_col);
sheet.getActiveSheet().addMergedRegion(s);
sheet.createnewsheet(“name”,100,10);
CellRangeAddress s=new CellRangeAddress(start_row,start_row ,start_col ,end_col);
sheet.getActiveSheet().addMergedRegion(s);

both mergedregion comes in same range but sheets are different

when am run this code it throws llegal state exception or null pointer exception