Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8544409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:33:02+00:00 2026-06-11T12:33:02+00:00

package jexcel.jxl.nimit; import java.awt.Label; import java.io.File; import java.io.IOException; import jxl.Cell; import jxl.CellType; import jxl.LabelCell;

  • 0
 package jexcel.jxl.nimit;

    import java.awt.Label;  
    import java.io.File;  
    import java.io.IOException;

    import jxl.Cell;   
    import jxl.CellType;  
    import jxl.LabelCell;  
    import jxl.NumberCell;  
    import jxl.Sheet;  
    import jxl.Workbook;  
    import jxl.read.biff.BiffException;  
    import jxl.write.WritableCell;  
    import jxl.write.WritableSheet;  
    import jxl.write.WritableWorkbook;  
    import jxl.write.WriteException;  
    import jxl.write.biff.RowsExceededException;  

    public class ExcelJxl {

    /**
     * @param args
     * @throws IOException 
     * @throws BiffException 
     * @throws WriteException 
     * @throws RowsExceededException 
     */
    public static void main(String[] args) throws BiffException, IOException, RowsExceededException, WriteException {
        // TODO Auto-generated method stub
             ExcelJxl.WriteFile("D:\nimit.xls");
    }

    public static void WriteFile(String path) throws BiffException, IOException, RowsExceededException, WriteException{

    Workbook wb=Workbook.getWorkbook(new File(path));

    WritableWorkbook copy=Workbook.createWorkbook(new File("D:\temp.xls"),wb);
    WritableSheet sheet = copy.getSheet(1); 
    WritableCell cell = sheet.getWritableCell(0,0); 
    String S="nimit";
    if (cell.getType() == CellType.LABEL) 
    { 
      LabelCell l = (LabelCell) cell; 
      l.setString(S); 
    }
    copy.write(); 
    copy.close();
    wb.close();

    }
   }

I have edited my program, and now it says that setString() The method setString(String) is undefined for the type LabelCell I read the Documentation, there is a method setString in the LabelCell type.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T12:33:04+00:00Added an answer on June 11, 2026 at 12:33 pm

    LabelCell is just an interface with only one method i.e getString() you can learn more about it here

    You should use jxl.write.Label instead.
    What you should exactly do is as follows
    You should import the following file

    import jxl.write.Label
    

    Then following is the code for adding a cell at desired location to an excel file

    Workbook existingWorkbook = Workbook.getWorkbook(new File(fileToEdit.getAbsolutePath()));
    WritableWorkbook workbookCopy = Workbook.createWorkbook(new File("output.xls"), existingWorkbook);
    WritableSheet sheetToEdit = workbookCopy.getSheet(sheetName);
    WritableCell cell;
    Label l = new Label(currentColumn, currentRow, value);
    cell = (WritableCell) l;
    sheetToEdit.addCell(cell);
     workbookCopy.write();
     workbookCopy.close();
     existingWorkbook.close();
    

    currentColumn and currentRow define the index and value contains the String to be placed in that cell.

    Hope it helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

package jexcel.jxl.nimit; import java.io.File; import java.io.IOException; import jxl.Cell; import jxl.CellType; import jxl.LabelCell; import jxl.Sheet;
package jexcel.jxl.nimit; import java.io.*; import jxl.Cell; import jxl.Sheet; import jxl.Workbook; import jxl.read.biff.BiffException; import jxl.read.biff.File;
package com.test.methods; import java.io.BufferedReader; import java.io.DataInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException;
package mp1practice; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.logging.Level;
package src; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Command { public static
package test; import java.awt.*; import java.awt.event.*; import java.awt.geom.Ellipse2D; import java.awt.image.BufferedImage; import javax.swing.*; public class
package com.crumbin.tabs; //java package import java.io.IOException; import java.util.ArrayList; import org.json.JSONException; import android.app.Activity; import android.app.AlertDialog;
package net.learn2develop.PopularAttractions; import java.io.IOException; import java.util.List; import java.util.Locale; import com.google.android.maps.GeoPoint; import com.google.android.maps.MapActivity; import com.google.android.maps.MapController;
package mp1similar; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.StringTokenizer;
package mp1similar; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.StringTokenizer;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.