Home  Products  Purchase  Downloads  Demos  Forums  Blogs  Ticket  Wiki  API  Corporate


com.aspose.cells
Class Workbook

java.lang.Object
  extended by com.aspose.cells.Workbook

public class Workbook
extends java.lang.Object

Represents an Workbook Object.


Constructor Summary
Workbook()
          Constructs a workbook object using default settings.
 
Method Summary
 void calculateFormula()
          Calculates the result of formulas.
 void calculateFormula(boolean ignoreError)
          Calculates the result of formulas.
 void calculateFormula(boolean ignoreError, ICustomFunction customFunction)
          Calculates the result of formulas.
 void combine(Workbook source)
          Combines another Workbook object.
 void copy(Workbook source)
          Copys contents and formats from another workbook.
 Worksheet createSheet()
          Deprecated. Replaced by Worksheets.addSheet().
 Worksheet createSheet(java.lang.String sheetName)
          Deprecated. Replaced by Worksheets.addSheet(String).
 Style createStyle()
          Creates a new style.
 Worksheet getActiveSheet()
          Deprecated. Replaced by Worksheets.getActiveSheet().
 int getActiveSheetIndex()
          Deprecated. Replaced by Worksheets.getActiveSheetIndex().
 int getCalculationMode()
          Returns the calculation mode.
 DataSorter getDataSorter()
          Gets DataSorter Object
 Style getDefaultStyle()
          Gets the default style of the workbook.
 int getFileFormatType()
          Gets the file format type after this workbook opens data.
 short getLanguage()
          Gets the user interface language of the Workbook version that has saved the file.
 Style getNamedStyle(java.lang.String styleName)
          Gets a style by it's name.
 Style[] getNamedStyles()
          Gets all named styles within the workbook.
 int getNumberOfSheets()
          Deprecated. Replaced by Worksheets.size().
 OpenOptions getOpenOptions()
          Provides options to control how the workbook is opened.
 Palette getPalette()
          Gets the palette of the workbook.
 short getRegion()
          Gets the system regional settings at the time the file was saved.
 SaveOptions getSaveOptions()
          Provides options to control how the workbook is saved.
 Worksheet getSheet(int index)
          Deprecated. Replaced by Worksheets.getSheet(int).
 Worksheet getSheet(java.lang.String name)
          Deprecated. Replaced by Worksheets.getSheet(String).
 int getSheetIndex(java.lang.String name)
          Deprecated. Replaced by Worksheets.getSheetIndex(String).
 java.lang.String getSheetName(int index)
          Deprecated. Replaced by Worksheets.getSheetName(int).
 Worksheets getWorksheets()
          Gets the Worksheets collection in the spreadsheet.
 boolean hasMacro()
          Indicates if this spreadsheet contains macro/VBA.
 int insertName(java.lang.String text, java.lang.String refersTo)
          Defines a new name.
 boolean isCalculateBeforeSave()
          Whether workbooks are calculated before they're saved to disk (if the Calculation Mode is set to MANUAL).
 boolean isConvertNumericData()
          Indicates if convert string in text file to numeric data.
 boolean isDate1904()
          Indicates whether the workbook works with 1904 date system.
 boolean isHorizontalScrollBarHidden()
          Checks if the horizontal scroll bar is hidden.
 boolean isProtected(byte protectionType)
          Indicates if the workbook is protected or the file is protected.
 boolean isSheetTabBarHidden()
          Checks if the sheet tab bar is hidden.
 boolean isVerticalScrollBarHidden()
          Checks if the vertical scroll bar is hidden.
 boolean isWorkbookProtected()
          Indicates if the workbook is protected.
 boolean isZS()
          Indicates whether RC-style addresses is Z1S1 style.
 void loadData(java.io.InputStream stream)
          Loads data from an Excel file.
 void loadData(java.io.InputStream stream, java.lang.String password)
          Loads data from an Excel file.
 void loadData(java.lang.String fileName)
          Loads data from an Excel file.
 void loadData(java.lang.String fileName, java.lang.String password)
          Loads data from an Excel file.
 void moveSheet(int origin, int dest)
          Deprecated. Replaced by Worksheets.moveSheet(int,int).
 void open(java.io.InputStream stream)
          Opens an Workbook file from the given stream.
 void open(java.io.InputStream stream, char separator, boolean convertNumericData, java.lang.String charsetName)
          Opens text files with user defined separator.
 void open(java.io.InputStream stream, int fileFormatType)
          Opens an Workbook file from the given stream.
 void open(java.io.InputStream stream, int fileFormatType, java.lang.String password)
          Opens an Workbook file from the given stream.
 void open(java.lang.String fileName)
          Opens an Workbook file from disk.
 void open(java.lang.String fileName, char separator, boolean convertNumericData, java.lang.String charsetName)
          Opens text files with user defined separator.
 void open(java.lang.String fileName, int fileFormatType)
          Opens an Workbook file from disk.
 void open(java.lang.String fileName, int fileFormatType, java.lang.String password)
          Opens an Workbook file from disk.
 void protectFile(byte protectionType, java.lang.String password)
          Protects a file.
 void protectWorkbook(byte protectionType, java.lang.String password)
          Protects a workbook.
 void read(java.io.InputStream stream)
          Deprecated. Replaced by open(stream).
 void read(java.lang.String fileName)
          Deprecated. Replaced by open(fileName).
 void removeSheet(int index)
          Deprecated. Replaced by Worksheets.removeSheet(int).
 boolean removeSheet(java.lang.String sheetName)
          Deprecated. Replaced by Worksheets.removeSheet(String).
 boolean removeSheet(Worksheet sheet)
          Deprecated. Replaced by Worksheets.removeSheet(Worksheet).
 void save(java.io.OutputStream stream)
          Saves the workbook to the given stream.
 void save(java.io.OutputStream stream, char separator, java.lang.String charsetName)
          Creates text files with user defined separator.
 void save(java.io.OutputStream stream, int fileFormatType)
          Saves the workbook to the given stream.
 void save(java.lang.String fileName)
          Saves the workbook to a file.
 void save(java.lang.String fileName, char separator, java.lang.String charsetName)
          Creates text files with user defined separator.
 void save(java.lang.String fileName, int fileFormatType)
          Saves the workbook to a file.
 void setCalculateBeforeSave(boolean calculateBeforeSave)
          Sets whether workbooks are calculated before they're saved to disk.
 void setCalculationMode(int calculationMode)
          Sets the calculation mode.
 void setConvertNumericData(boolean convertNumericData)
          Indicates if convert string in text file to numeric data.
 void setDate1904(boolean isDate1904)
          Sets whether the workbook works with 1904 date system.
 void setEncryptionOption(byte encryptionType, int keyLength)
          Sets Encryption Options.
 void setFileFormatType(int fileFormatType)
          Sets the file format type for this workbook.
 void setHorizontalScrollBarHidden(boolean isHidden)
          Sets the horizontal scroll bar to be hidden or not.
 void setIsZS(boolean isZS)
          Indicates whether RC-style addresses is Z1S1 style.
 void setLanguage(short countryCode)
          Sets the user interface language of the Workbook version that has saved the file.
 void setLocale(java.util.Locale locale)
          Sets locale region at the time the file was saved.
 void setOleSize(int startRow, int endRow, int startColumn, int endColumn)
          Sets displayed size when Workbook file is used as an Ole object.
 void setProtectedBy(java.lang.String user)
          Sets the user who reserved this workbook by protect file with type ProtectionType.MODIFY_FILE
 void setRegion(short countryCode)
          Sets the system regional settings at the time the file was saved.
 void setSheetTabBarHidden(boolean isHidden)
          Sets the sheet tab bar to be hidden or not.
 void setVerticalScrollBarHidden(boolean isHidden)
          Sets the vertical scroll bar to be hidden or not.
 void swapSheet(int idx1, int idx2)
          Deprecated. Replaced by Worksheets.swapSheet(int,int).
 void unprotectWorkbook(java.lang.String password)
          Unprotects a workbook.
 void write(java.io.OutputStream stream)
          Deprecated. Replaced by save(stream).
 void write(java.io.OutputStream stream, int fileFormatType)
          Deprecated. Replaced by save(stream,fileFormatType).
 void write(java.lang.String fileName)
          Deprecated. Replaced by save(fileName).
 void write(java.lang.String fileName, int fileFormatType)
          Deprecated. Replaced by save(fileName,fileFormatType).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Workbook

public Workbook()
Constructs a workbook object using default settings. The workbook will only have one sheet with the name "Sheet1".

Method Detail

getLanguage

public short getLanguage()
Gets the user interface language of the Workbook version that has saved the file.

Returns:
the user interface language of the Workbook version that has saved the file.
See Also:
CountryCode

setLanguage

public void setLanguage(short countryCode)
Sets the user interface language of the Workbook version that has saved the file.

Parameters:
countryCode - the user interface language of the Workbook version that has saved the file.
See Also:
CountryCode

getRegion

public short getRegion()
Gets the system regional settings at the time the file was saved.

Returns:
the system regional settings at the time the file was saved.
See Also:
CountryCode

setRegion

public void setRegion(short countryCode)
Sets the system regional settings at the time the file was saved.

Parameters:
countryCode - the system regional settings at the time the file was saved.
See Also:
CountryCode

setLocale

public void setLocale(java.util.Locale locale)
Sets locale region at the time the file was saved. It will auto set system regional settings and interface language.

Parameters:
locale - the Locale object.

isZS

public boolean isZS()
Indicates whether RC-style addresses is Z1S1 style.

Returns:
Indicates whether RC-style addresses is Z1S1 style.

setIsZS

public void setIsZS(boolean isZS)
Indicates whether RC-style addresses is Z1S1 style. True only applies for German language. If true and you want to set RC formula to the cell, you should call cell.setR1C1Formula("=Z1S1") not cell.setR1C1Formula("=R1C1")

Parameters:
isZS - whether RC-style addresses is Z1S1 style.

copy

public void copy(Workbook source)
Copys contents and formats from another workbook.

Parameters:
source - the source workbook.

combine

public void combine(Workbook source)
Combines another Workbook object. Currently we only combine the sheet and data into this workbook.

Parameters:
source - The Workbook object to be combined into this one.

getFileFormatType

public int getFileFormatType()
Gets the file format type after this workbook opens data.

Returns:
the file format type after this workbook opens data. Before opens data, the file format type is FileFormatType.UNKNOWN

setFileFormatType

public void setFileFormatType(int fileFormatType)
Sets the file format type for this workbook. The file format type will be used in some situations such as:
1. When save this workbook without specifing file format, the workbook will be saved as the file format specified here.
2. The row/column limit of cell reference will depend on the file format type specified here when setting formulas.
3. The image generated from Chart may be different because the different file format type

Parameters:
fileFormatType - the file format type of this workbook.

getSaveOptions

public SaveOptions getSaveOptions()
Provides options to control how the workbook is saved.

Returns:
the SaveOptions object.

getOpenOptions

public OpenOptions getOpenOptions()
Provides options to control how the workbook is opened.

Returns:
the OpenOptions object.

open

public void open(java.io.InputStream stream)
          throws java.io.IOException
Opens an Workbook file from the given stream.

Parameters:
stream - the stream to read from.
Throws:
java.io.IOException - if an I/O error occurs.

open

public void open(java.lang.String fileName)
          throws java.io.IOException
Opens an Workbook file from disk.

Parameters:
fileName - the system-dependent file name.
Throws:
java.io.IOException - if an error occurs.

open

public void open(java.io.InputStream stream,
                 int fileFormatType)
          throws java.io.IOException
Opens an Workbook file from the given stream.

Parameters:
stream - the stream to read from.
fileFormatType - one of the FileFormatType values whcih specifies the file format.
Throws:
java.io.IOException - if an I/O error occurs.

open

public void open(java.io.InputStream stream,
                 int fileFormatType,
                 java.lang.String password)
          throws java.io.IOException
Opens an Workbook file from the given stream.

Parameters:
stream - the stream to read from.
fileFormatType - one of the FileFormatType values whcih specifies the file format.
password - file encryption password.
Throws:
java.io.IOException - if an I/O error occurs.

open

public void open(java.lang.String fileName,
                 int fileFormatType,
                 java.lang.String password)
          throws java.io.IOException
Opens an Workbook file from disk.

Parameters:
fileName - the system-dependent file name.
fileFormatType - one of the FileFormatType values whcih specifies the file format.
password - file encryption password.
Throws:
java.io.IOException - if an error occurs.

open

public void open(java.lang.String fileName,
                 int fileFormatType)
          throws java.io.IOException
Opens an Workbook file from disk.

Parameters:
fileName - the system-dependent file name.
fileFormatType - one of the FileFormatType values whcih specifies the file format.
Throws:
java.io.IOException - if an error occurs.

open

public void open(java.lang.String fileName,
                 char separator,
                 boolean convertNumericData,
                 java.lang.String charsetName)
          throws java.io.IOException
Opens text files with user defined separator.

Parameters:
fileName - Text file name.
separator - Delimiter of text file.
convertNumericData - Indicates if convert string in text file to numeric data.
charsetName - The name of a charset,Null : default charset.
Throws:
java.io.IOException - if an I/O error occurs.

open

public void open(java.io.InputStream stream,
                 char separator,
                 boolean convertNumericData,
                 java.lang.String charsetName)
          throws java.io.IOException
Opens text files with user defined separator.

Parameters:
stream - The stream to read from.
separator - Delimiter of text file.
convertNumericData - Indicates if convert string in text file to numeric data.
charsetName - the name of a charset,Null : default charset.
Throws:
java.io.IOException - if an I/O error occurs.

loadData

public void loadData(java.lang.String fileName)
              throws java.io.IOException
Loads data from an Excel file. This method only loads data, formulas and formattings from an Excel file. Other contents and settings are all discarded. It runs faster and utilize less memory than open(String) method, so it's better to be used for applications which only need to process data in Excel file.

Parameters:
fileName - Name of imported Excel file.
Throws:
java.io.IOException

loadData

public void loadData(java.lang.String fileName,
                     java.lang.String password)
              throws java.io.IOException
Loads data from an Excel file. This method only loads data, formulas and formattings from an Excel file. Other contents and settings are all discarded. It runs faster and utilize less memory than open(String) method, so it's better to be used for applications which only need to process data in Excel file.

Parameters:
fileName - Name of imported Excel file.
password - file encryption password.
Throws:
java.io.IOException

loadData

public void loadData(java.io.InputStream stream,
                     java.lang.String password)
              throws java.io.IOException
Loads data from an Excel file. This method only loads data, formulas and formattings from an Excel file. Other contents and settings are all discarded. It runs faster and utilize less memory than open(InputStream) method, so it's better to be used for applications which only need to process data in Excel file.

Parameters:
stream - the stream to read from.
password - file encryption password.
Throws:
java.io.IOException

loadData

public void loadData(java.io.InputStream stream)
              throws java.io.IOException
Loads data from an Excel file. This method only loads data, formulas and formattings from an Excel file. Other contents and settings are all discarded. It runs faster and utilize less memory than open(InputStream) method, so it's better to be used for applications which only need to process data in Excel file.

Parameters:
stream - the stream to read from.
Throws:
java.io.IOException

save

public void save(java.io.OutputStream stream)
          throws java.io.IOException
Saves the workbook to the given stream. If file format type has been set(by setFileFormatType(int) or by openning a template file), then save as the specified file format. Otherwise save as FileFormatType.EXCEL97TO2003.

Parameters:
stream - the stream to write to.
Throws:
java.io.IOException - if an I/O error occurs.

save

public void save(java.io.OutputStream stream,
                 int fileFormatType)
          throws java.io.IOException
Saves the workbook to the given stream. For FileFormatType.CSV and FileFormatType.HTML, will only save the active sheet.

Parameters:
stream - the stream to write to.
fileFormatType - one of the FileFormatType values whcih specifies the file format.
Throws:
java.io.IOException - if an I/O error occurs.

save

public void save(java.lang.String fileName)
          throws java.io.IOException
Saves the workbook to a file. If file format type has been set(by setFileFormatType(int) or by openning a template file), then save as the specified file format. Otherwise a file format type that matchs given file name will be used to save this workbook.

Parameters:
fileName - the system-dependent file name.
Throws:
java.io.IOException - if an I/O error occurs.

save

public void save(java.lang.String fileName,
                 int fileFormatType)
          throws java.io.IOException
Saves the workbook to a file. For FileFormatType.CSV, will only save the active sheet.

Parameters:
fileName - the system-dependent file name.
fileFormatType - one of the FileFormatType values whcih specifies the file format.
Throws:
java.io.IOException - if an I/O error occurs.
See Also:
FileFormatType

save

public void save(java.lang.String fileName,
                 char separator,
                 java.lang.String charsetName)
          throws java.io.IOException
Creates text files with user defined separator.

Parameters:
fileName - Text file name.
separator - Delimiter of text file.
charsetName - the name of a charset.
Throws:
java.io.IOException - if an I/O error occurs.

save

public void save(java.io.OutputStream stream,
                 char separator,
                 java.lang.String charsetName)
          throws java.io.IOException
Creates text files with user defined separator.

Parameters:
stream - The stream to write to.
separator - Delimiter of text file.
charsetName - the name of a charset.
Throws:
java.io.IOException - if an I/O error occurs.

getWorksheets

public Worksheets getWorksheets()
Gets the Worksheets collection in the spreadsheet.

Returns:
the Worksheets collection in the spreadsheet.

getDefaultStyle

public Style getDefaultStyle()
Gets the default style of the workbook.

Returns:
the default style of the workbook.

createStyle

public Style createStyle()
Creates a new style.

Returns:
the new style.

getNamedStyle

public Style getNamedStyle(java.lang.String styleName)
Gets a style by it's name.

Parameters:
styleName - name of the style.
Returns:
the style. Returns null if the style name is invalid.

getNamedStyles

public Style[] getNamedStyles()
Gets all named styles within the workbook.

Returns:
an array of named styles.

isHorizontalScrollBarHidden

public boolean isHorizontalScrollBarHidden()
Checks if the horizontal scroll bar is hidden.

Returns:
true if the horizontal scroll bar is hidden.

isVerticalScrollBarHidden

public boolean isVerticalScrollBarHidden()
Checks if the vertical scroll bar is hidden.

Returns:
true if the vertical scroll bar is hidden.

isSheetTabBarHidden

public boolean isSheetTabBarHidden()
Checks if the sheet tab bar is hidden.

Returns:
true if the sheet tab bar is hidden.

setHorizontalScrollBarHidden

public void setHorizontalScrollBarHidden(boolean isHidden)
Sets the horizontal scroll bar to be hidden or not.

Parameters:
isHidden - true for hidden; false otherwise.

setVerticalScrollBarHidden

public void setVerticalScrollBarHidden(boolean isHidden)
Sets the vertical scroll bar to be hidden or not.

Parameters:
isHidden - true for hidden; false otherwise.

setSheetTabBarHidden

public void setSheetTabBarHidden(boolean isHidden)
Sets the sheet tab bar to be hidden or not.

Parameters:
isHidden - true for hidden; false otherwise.

getPalette

public Palette getPalette()
Gets the palette of the workbook. NOTE: Using a color that is not contained in the palette will not take effect. If you want to use a custom color in this workbook, please change the palette first.

Returns:
the palette of the workbook.

isCalculateBeforeSave

public boolean isCalculateBeforeSave()
Whether workbooks are calculated before they're saved to disk (if the Calculation Mode is set to MANUAL). This property is preserved even if you change the Calculation Mode.

Returns:
whether workbooks are calculated before they're saved to disk.

setCalculateBeforeSave

public void setCalculateBeforeSave(boolean calculateBeforeSave)
Sets whether workbooks are calculated before they're saved to disk.

Parameters:
calculateBeforeSave - whether workbooks are calculated before they're saved to disk.

getCalculationMode

public int getCalculationMode()
Returns the calculation mode.

Returns:
the calculation mode.
See Also:
setCalculationMode(int)

setCalculationMode

public void setCalculationMode(int calculationMode)
Sets the calculation mode.

Parameters:
calculationMode - calculation mode.It could be one of the following values:
CalculationMode.AUTOMATIC
CalculationMode.SEMIAUTOMATIC
CalculationMode.MANUAL
Throws:
java.lang.IllegalArgumentException - if calculation mode is invalid.

isConvertNumericData

public boolean isConvertNumericData()
Indicates if convert string in text file to numeric data. Only works for CSV and TabDelimited format.

Returns:
if convert string in text file to numeric data.

setConvertNumericData

public void setConvertNumericData(boolean convertNumericData)
Indicates if convert string in text file to numeric data. Only works for CSV and TabDelimited format.

Parameters:
convertNumericData - if convert string in text file to numeric data.

hasMacro

public boolean hasMacro()
Indicates if this spreadsheet contains macro/VBA.

Returns:
true if this spreadsheet contains macro/VBA

protectFile

public void protectFile(byte protectionType,
                        java.lang.String password)
Protects a file. NOTE: if the protectionType is OPEN_FILE, Only supports to remove the password, not supports to set the password.

Parameters:
protectionType - protection type.It could be one of the following values:
ProtectionType.OPEN_FILE
ProtectionType.MODIFY_FILE
password - password to protect the file. if password is null, it means unprotecting file.
Throws:
CellsException - if workbook is already protected.

setProtectedBy

public void setProtectedBy(java.lang.String user)
Sets the user who reserved this workbook by protect file with type ProtectionType.MODIFY_FILE

Parameters:
user - the user name.

setEncryptionOption

public void setEncryptionOption(byte encryptionType,
                                int keyLength)
Sets Encryption Options.

Parameters:
encryptionType - the encryption type. It could be one of the following values:
EncryptionType.STONG_CRYPTOGRAPHIC_PROVIDER
EncryptionType.XOR
keyLength - the key length.

isProtected

public boolean isProtected(byte protectionType)
Indicates if the workbook is protected or the file is protected.

Returns:
if the workbook is protected.

protectWorkbook

public void protectWorkbook(byte protectionType,
                            java.lang.String password)
Protects a workbook.

Parameters:
protectionType - protection type.It could be one of the following values:
ProtectionType.WORKBOOK_ALL
ProtectionType.STRUCTURE
ProtectionType.WINDOWS
password - password to protect the workbook.
Throws:
CellsException - if workbook is already protected.

unprotectWorkbook

public void unprotectWorkbook(java.lang.String password)
Unprotects a workbook.

Parameters:
password - password to unprotect the workbook.
Throws:
CellsException - if password is invalid.

isWorkbookProtected

public boolean isWorkbookProtected()
Indicates if the workbook is protected.

Returns:
if the workbook is protected.

isDate1904

public boolean isDate1904()
Indicates whether the workbook works with 1904 date system.

Returns:
whether the workbook works with 1904 date system.

setDate1904

public void setDate1904(boolean isDate1904)
Sets whether the workbook works with 1904 date system. Note : This option is only for MS Excel. Aspose.Cells for Java is always based on the 1900 date system.

Parameters:
isDate1904 - whether the workbook works with 1904 date system.

setOleSize

public void setOleSize(int startRow,
                       int endRow,
                       int startColumn,
                       int endColumn)
Sets displayed size when Workbook file is used as an Ole object.

Parameters:
startRow - start row index
endRow - end row index
startColumn - start column index
endColumn - end column index

calculateFormula

public void calculateFormula()
Calculates the result of formulas. This method does not support formulas with external links to other files. Now Excel built-in functions supported in this method:
Lists supported built-in functions in ascending order
[A]
ABS, ACOS, ACOSH, ADDRESS, AND, ASIN, ASINH
ATAN, ATAN2, ATANH, AVEDEV, AVERAGE, AVERAGEA
[B]
BINOMDIST [C]
CHAR, CEILING, CHITEST, CHIDIST, CHOOSE, CODE, COLUMN, COLUMNS
COMBIN, CONCATENATE, CONFIDENCE, CORREL
COS, COSH, COUNT, COUNTA, COUNTBLANK, COUNTIF, COVAR
CRITBINOM, CUMIPMT, CUMPRINC
[D]
DATE, DATEDIF, DATEVALUE, DAVERAGE, DAY, DAYS360
DB, DCOUNT, DCOUNTA, DDB, DEGREES, DEVSQ, DGET, DMAX, DMIN
DOLLAR, DPRODUCT, DSTDEV, DSTDEVP, DSUM, DVAR, DVARP
[E]
ERROR.TYPE, EVEN, EXACT, EXP, EXPONDIST
[F]
FACT, FALSE, FDIST, FIND, FISHER, FISHERINV, FIXED, FLOOR, FREQUENCY, FV
[G]
GAMMADIST, GAMMALN, GEOMEAN, GROWTH
[H]
HARMEAN, HLOOKUP, HOUR, HYPERLINK, HYPGEOMDIST
[I]
IF, INT, INTERCEPT, INDEX, INDIRECT, IPMT
ISBLANK, ISERR, ISERROR, ISEVEN, ISLOGICAL
ISNA, ISNONTEXT, ISNUMBER, ISODD, ISREF, ISTEXT
[L]
LARGE, LEFT, LEN, LINEST, LN, LOG, LOG10, LOGEST, LOOKUP, LOWER
[M]
MATCH, MAX, MAXA, MEDIAN, MID, MIN, MINA, MINUTE, MOD, MONTH, MROUND
[N]
N, NA, NEGBINOMDIST, NORMDIST, NORMINV, NORMSDIST, NORMSINV, NOT, NOW, NPV
[O]
ODD, OFFSET, OR
[P]
PEARSON, PERMUT, PI, PMT, POISSON, POWER, PPMT, PRODUCT, PROPER, PV
[R]
RADIANS, RAND, RANDBETWEEN, RANK, RATE, REPLACE, REPT, RIGHT
ROUND, ROUNDDOWN, ROUNDUP, ROW, ROWS, RSQ
[S]
SEARCH, SECOND, SIGN, SIN, SINH, SKEW, SLN, SLOPE, SMALL, SQRT
STANDARDIZE, STDEV, STDEVA, STDEVP, STDEVPA, STEYX, SUBSTITUTE, SUM, SUMIF
SUMPRODUCT, SUMSQ, SUMX2MY2, SUMX2PY2, SUMXMY2, SYD
[T]
T, TAN, TANH, TEXT, TIME, TIMEVALUE, TODAY, TREND, TRIM, TRIMMEAN, TRUE, TRUNC, TYPE
[U]
UPPER, USDOLLAR
[V]
VALUE, VAR, VARA, VARP, VARPA, VDB, VLOOKUP
[W]
WEEKDAY, WEEKNUM, WEIBULL
[Y]
YEAR


Lists supported built-in functions by category
[Database]
DCOUNT, DCOUNTA, DGET, DMAX, DMIN, DPRODUCT, DSTDEV, DSTDEVP, DSUM, DVAR, DVARP
[Date and Time]
DATE, DATEDIF, DATEVALUE, DAY, DAYS360
HOUR, MINUTE, MONTH, NOW, SECOND, TIME, TIMEVALUE, TODAY, WEEKDAY, WEEKNUM, YEAR

[Financial]
CUMIPMT, CUMPRINC, DB, DDB, FV, IPMT, NPV, PMT, PPMT, PV, RATE, SLN, SYD, VDB

[Information]
ERROR.TYPE, ISBLANK, ISERR, ISERROR, ISEVEN, ISLOGICAL, ISNA, ISNONTEXT, ISNUMBER
ISODD, ISREF, ISTEXT, N, NA, TYPE

[Logical]
AND, FALSE, IF, NOT, OR, TRUE

[Lookup and Reference]
ADDRESS, CHOOSE, COLUMN, COLUMNS
HLOOKUP, HYPERLINK, INDEX, INDIRECT, LOOKUP, MATCH, OFFSET
ROW, ROWS, VLOOKUP

[Math and Trigonometry]
ABS, ACOS, ACOSH, ASIN, ASINH, ATAN, ATAN2, ATANH
CEILING, COMBIN, COS, COSH, DEGREES, EVEN, EXP, FACT, FLOOR
INT, LN, LOG, LOG10, MOD, ODD, PI, POWER, PRODUCT
RADIANS, RAND, RANDBETWEEN, ROMAN, ROUND, ROUNDDOWN, ROUNDUP
SIGN, SIN, SINH, SQRT, SUM, SUMIF, SUMPRODUCT, SUMSQ, SUMX2MY2, SUMX2PY2, SUMXMY2
TAN, TANH, TRUNC

[Statistical]
AVEDEV, AVERAGE, AVERAGEA, BINOMDIST
CHITEST, CHIDIST, CONFIDENCE, CORREL, COUNT, COUNTA, COUNTBLANK, COUNTIF, COVAR, CRITBINOM
DEVSQ, EXPONDIST, FDIST, FISHER, FISHERINV, FREQUENCY, GAMMADIST, GAMMALN, GEOMEAN, GROWTH, HARMEAN, HYPGEOMDIST
INTERCEPT, LARGE, LINEST, LOGEST, MAX, MAXA, MEDIAN, MIN, MINA
NEGBINOMDIST, NORMDIST, NORMINV, NORMSDIST, NORMSINV
PEARSON, PERMUT, POISSON, RANK, RSQ
SKEW, SLOPE, SMALL, STANDARDIZE, STDEV, STDEVA, STDEVP, STDEVPA, STEYX
TREND, TRIMMEAN, VAR, VARA, VARP, VARPA, WEIBULL

[Text]
CHAR, CODE, CONCATENATE, DOLLAR, EXACT, FIXED, FIND, LEFT, LEN, LOWER, MID
PROPER, REPLACE, REPLACEB, REPT, RIGHT, SEARCH, SUBSTITUTE
T, TEXT, TRIM, UPPER, USDOLLAR, VALUE

Throws:
CellsException - if the cell has been removed from the worksheet.

calculateFormula

public void calculateFormula(boolean ignoreError,
                             ICustomFunction customFunction)
                      throws FormulaCalcException
Calculates the result of formulas.

Parameters:
ignoreError - Indicates if hide the error in calculating formulas. The error may be unsupported function, external links, etc.
customFunction - Custom function interface to extend formula calculation engine.
Throws:
FormulaCalcException - if an error occurs and not hide the error.

calculateFormula

public void calculateFormula(boolean ignoreError)
                      throws FormulaCalcException
Calculates the result of formulas.

Parameters:
ignoreError - Indicates if hide the error in calculating formulas. The error may be unsupported function, external links, etc.
Throws:
FormulaCalcException - if an error occurs and not hide the error.
See Also:
calculateFormula()

insertName

public int insertName(java.lang.String text,
                      java.lang.String refersTo)
               throws java.io.UnsupportedEncodingException
Defines a new name.

Parameters:
text - the name text of the user-defined name.
refersTo - the formula that the name is defined to refer to, beginning with an equal sign.
Returns:
Name object index.
Throws:
java.lang.IllegalArgumentException - if refersTo is null or formulas in the refersTo are unspported.
java.io.UnsupportedEncodingException - if text contains unsupported encoding.

read

@Deprecated
public void read(java.io.InputStream stream)
          throws java.io.IOException
Deprecated. Replaced by open(stream).

Reads an Workbook file from the given stream.

Parameters:
stream - the stream to read from.
Throws:
java.io.IOException - if an I/O error occurs.

read

@Deprecated
public void read(java.lang.String fileName)
          throws java.io.IOException
Deprecated. Replaced by open(fileName).

Reads an Workbook file from disk.

Parameters:
fileName - the system-dependent file name.
Throws:
java.io.IOException - if an error occurs.

write

@Deprecated
public void write(java.io.OutputStream stream)
           throws java.io.IOException
Deprecated. Replaced by save(stream).

Writes out the workbook to the given stream.

Parameters:
stream - the stream to write to.
Throws:
java.io.IOException - if an I/O error occurs.

write

@Deprecated
public void write(java.io.OutputStream stream,
                             int fileFormatType)
           throws java.io.IOException
Deprecated. Replaced by save(stream,fileFormatType).

Writes out the workbook to the given stream.

Parameters:
stream - the stream to write to.
fileFormatType - one of the FileFormatType values whcih specifies the file format.
Throws:
java.io.IOException - if an I/O error occurs.

write

@Deprecated
public void write(java.lang.String fileName)
           throws java.io.IOException
Deprecated. Replaced by save(fileName).

Writes out the workbook to a file.

Parameters:
fileName - the system-dependent file name.
Throws:
java.io.IOException - if an I/O error occurs.

write

@Deprecated
public void write(java.lang.String fileName,
                             int fileFormatType)
           throws java.io.IOException
Deprecated. Replaced by save(fileName,fileFormatType).

Writes out the workbook to a file.

Parameters:
fileName - the system-dependent file name.
fileFormatType - one of the FileFormatType values whcih specifies the file format.
Throws:
java.io.IOException - if an I/O error occurs.
See Also:
FileFormatType

getNumberOfSheets

@Deprecated
public int getNumberOfSheets()
Deprecated. Replaced by Worksheets.size().

Gets the number of sheets in the workbook.

Returns:
number of sheets.

getSheet

@Deprecated
public Worksheet getSheet(int index)
Deprecated. Replaced by Worksheets.getSheet(int).

Returns the sheet at the specified index.

Parameters:
index - index of the sheet.
Returns:
the sheet at the specified index.
Throws:
java.lang.IllegalArgumentException - if the index is out of range.

getSheet

@Deprecated
public Worksheet getSheet(java.lang.String name)
Deprecated. Replaced by Worksheets.getSheet(String).

Gets the sheet with the specified name.

Parameters:
name - name of the sheet.
Returns:
the sheet that has the specified name. Returns null if the sheet name is invalid.

getSheetIndex

@Deprecated
public int getSheetIndex(java.lang.String name)
Deprecated. Replaced by Worksheets.getSheetIndex(String).

Gets the sheet's index according to its name.

Parameters:
name - name of the sheet.
Returns:
index of the sheet. Returns -1 if the sheet name is invalid.

getSheetName

@Deprecated
public java.lang.String getSheetName(int index)
Deprecated. Replaced by Worksheets.getSheetName(int).

Returns the name of the sheet at the specified index.

Parameters:
index - index of the sheet.
Returns:
sheet name.
Throws:
java.lang.IllegalArgumentException - if the index is out of range.

createSheet

@Deprecated
public Worksheet createSheet()
Deprecated. Replaced by Worksheets.addSheet().

Creates a new worksheet in this workbook. The sheet name is assigned automatically.

Returns:
the created worksheet.

createSheet

@Deprecated
public Worksheet createSheet(java.lang.String sheetName)
Deprecated. Replaced by Worksheets.addSheet(String).

Creates a new worksheet in this workbook with the specified sheet name.

Parameters:
sheetName - name of the worksheet.
Returns:
the created worksheet.

swapSheet

@Deprecated
public void swapSheet(int idx1,
                                 int idx2)
Deprecated. Replaced by Worksheets.swapSheet(int,int).

Swaps the positions of two sheets.

Parameters:
idx1 - index of the first sheet
idx2 - index of the second sheet
Throws:
java.lang.IllegalArgumentException - if any of the positions is out of range.

moveSheet

@Deprecated
public void moveSheet(int origin,
                                 int dest)
Deprecated. Replaced by Worksheets.moveSheet(int,int).

Moves a worksheet.

Parameters:
origin - the original index of the sheet.
dest - the new index of the sheet.
Throws:
java.lang.IllegalArgumentException - if any of the indexes is out of range.

removeSheet

@Deprecated
public void removeSheet(int index)
Deprecated. Replaced by Worksheets.removeSheet(int).

Removes the sheet at the specified index. Once a sheet is removed, operations on it may cause an CellsException.

Parameters:
index - index of the sheet.
Throws:
java.lang.IllegalArgumentException - if index is out of range.

removeSheet

@Deprecated
public boolean removeSheet(Worksheet sheet)
Deprecated. Replaced by Worksheets.removeSheet(Worksheet).

Removes the specified worksheet. Once a sheet is removed, operations on it may cause an CellsException.

Parameters:
sheet - the sheet to remove.
Returns:
true if the sheet exists and is removed successfully.

removeSheet

@Deprecated
public boolean removeSheet(java.lang.String sheetName)
Deprecated. Replaced by Worksheets.removeSheet(String).

Removes the specified sheet from the workbook. Once a sheet is removed, operations on it may cause an CellsException.

Parameters:
sheetName - name of the sheet to remove
Returns:
true if the sheet exists and is removed successfully.

getActiveSheetIndex

@Deprecated
public int getActiveSheetIndex()
Deprecated. Replaced by Worksheets.getActiveSheetIndex().

Gets the active sheet index.

Returns:
the active sheet index.

getActiveSheet

@Deprecated
public Worksheet getActiveSheet()
Deprecated. Replaced by Worksheets.getActiveSheet().

Gets the active sheet.

Returns:
the active sheet.

getDataSorter

public DataSorter getDataSorter()
Gets DataSorter Object

Returns:
DataSorter Object