Free Support Forum - aspose.com

Jar for aspose.cells

Hi,

I have started my first java application using aspose cells, but im unable to access the classes of aspose.cells. I mean which jar shold be included to solve the problem. Can u plz help me soon. If u have any already built simple java application along with imports plz help me. Thanx in advance


This message was posted using Page2Forum from Downloads - Aspose.Cells for .NET and Java

Hi,

Thanks for considering Aspose.

If you have downloaded the Aspose.Cells.zip, unzip it to your system. Now get Aspose.Cells.jar and dom4j-1.6.1.jar from "..\JDK 5.0\lib\" to your specified directory and set the class path to add reference to those two files. Now you can create Java applications that can use the component.

Example:

import java.io.*;
import com.aspose.cells.*;

class HelloWorld
{


public static void main(String []args)
{

try
{

//Instantiate a Workbook object that represents Excel file.
Workbook wb = new Workbook();

//Note when you create a new workbook, a default worksheet
//"Sheet1" is added (by default) to the workbook.
//Access the first worksheet "Sheet1" in the book.
Worksheet sheet = wb.getWorksheets().getSheet(0);


//Access the "A1" cell in the sheet.
Cell cell = sheet.getCells().getCell("A1");


//Input the "Hello World!" text into the "A1" cell
cell.setValue("Hello World!");


//Save the Excel file.
wb.save("E:\\MyBook.xls",FileFormatType.EXCEL2003);


}

catch(Exception ee)
{

System.out.println(ee);
}


}

}

For further reference about Aspose.Cells for Java documentation Programmer's guide and API reference, kindly check the following (Kindly check different sections and explore their topics and subtopics to know how to implement / use different features for your applications) :

http://www.aspose.com/documentation/file-format-components/aspose.cells-for-.net-and-java/programmers-guide.html

http://www.aspose.com/documentation/file-format-components/aspose.cells-for-.net-and-java/aspose.cells-for-java-api-reference.html

Thank you.

Assalamualaikum,

Thanks for giving correct solution.

I have a task where i have to create cells in a worksheet,so that only selected cells should be editable or writable and other cells should be read only. Should i protect the whole worksheet or how can i lock certain cells in a worksheet. Please help with some code.

Thanx in advance.

Hi,

Kindly check the following documentation topics for your need:

http://www.aspose.com/documentation/file-format-components/aspose.cells-for-.net-and-java/protecting-worksheets.html

http://www.aspose.com/documentation/file-format-components/aspose.cells-for-.net-and-java/advanced-protection-settings-since-excel-xp.html

http://www.aspose.com/documentation/file-format-components/aspose.cells-for-.net-and-java/unprotect-a-worksheet.html

Thank you.