\PHPExcel

PHPExcel

Summary

Methods
Properties
Constants
hasMacros()
setHasMacros()
setMacrosCode()
getMacrosCode()
setMacrosCertificate()
hasMacrosCertificate()
getMacrosCertificate()
discardMacros()
setRibbonXMLData()
getRibbonXMLData()
setRibbonBinObjects()
getRibbonBinObjects()
hasRibbon()
hasRibbonBinObjects()
sheetCodeNameExists()
getSheetByCodeName()
__construct()
__destruct()
disconnectWorksheets()
getCalculationEngine()
getProperties()
setProperties()
getSecurity()
setSecurity()
getActiveSheet()
createSheet()
sheetNameExists()
addSheet()
removeSheetByIndex()
getSheet()
getAllSheets()
getSheetByName()
getIndex()
setIndexByName()
getSheetCount()
getActiveSheetIndex()
setActiveSheetIndex()
setActiveSheetIndexByName()
getSheetNames()
addExternalSheet()
getNamedRanges()
addNamedRange()
getNamedRange()
removeNamedRange()
getWorksheetIterator()
copy()
__clone()
getCellXfCollection()
getCellXfByIndex()
getCellXfByHashCode()
cellXfExists()
getDefaultStyle()
addCellXf()
removeCellXfByIndex()
getCellXfSupervisor()
getCellStyleXfCollection()
getCellStyleXfByIndex()
getCellStyleXfByHashCode()
addCellStyleXf()
removeCellStyleXfByIndex()
garbageCollect()
getID()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
_getExtensionOnly()
$_uniqueID
$_properties
$_security
$_workSheetCollection
$_calculationEngine
$_activeSheetIndex
$_namedRanges
$_cellXfSupervisor
$_cellXfCollection
$_cellStyleXfCollection
$_hasMacros
$_macrosCode
$_macrosCertificate
$_ribbonXMLData
$_ribbonBinObjects
N/A

Properties

$_uniqueID

$_uniqueID : string

Unique ID

Type

string

$_workSheetCollection

$_workSheetCollection : \PHPExcel_Worksheet[]

Collection of Worksheet objects

Type

PHPExcel_Worksheet[]

$_calculationEngine

$_calculationEngine : \PHPExcel_Calculation

Calculation Engine

Type

PHPExcel_Calculation

$_activeSheetIndex

$_activeSheetIndex : int

Active sheet index

Type

int

$_cellXfSupervisor

$_cellXfSupervisor : \PHPExcel_Style

CellXf supervisor

Type

PHPExcel_Style

$_cellXfCollection

$_cellXfCollection : \PHPExcel_Style[]

CellXf collection

Type

PHPExcel_Style[]

$_cellStyleXfCollection

$_cellStyleXfCollection : \PHPExcel_Style[]

CellStyleXf collection

Type

PHPExcel_Style[]

$_hasMacros

$_hasMacros : bool

_hasMacros : this workbook have macros ?

Type

bool

$_macrosCode

$_macrosCode : \binary

_macrosCode : all macros code (the vbaProject.bin file, this include form, code, etc.), NULL if no macro

Type

\binary —

$_macrosCertificate

$_macrosCertificate : \binary

_macrosCertificate : if macros are signed, contains vbaProjectSignature.bin file, NULL if not signed

Type

\binary —

$_ribbonXMLData

$_ribbonXMLData : null|string

_ribbonXMLData : NULL if workbook is'nt Excel 2007 or not contain a customized UI

Type

null|string

$_ribbonBinObjects

$_ribbonBinObjects : null|array

_ribbonBinObjects : NULL if workbook is'nt Excel 2007 or not contain embedded objects (picture(s)) for Ribbon Elements ignored if $_ribbonXMLData is null

Type

null|array

Methods

hasMacros()

hasMacros() : true

The workbook has macros ?

Returns

true —

if workbook has macros, false if not

setHasMacros()

setHasMacros(mixed  $hasMacros = false) : mixed

Define if a workbook has macros

Parameters

mixed $hasMacros

Returns

mixed —

setMacrosCode()

setMacrosCode(mixed  $MacrosCode) : mixed

Set the macros code

Parameters

mixed $MacrosCode

Returns

mixed —

getMacrosCode()

getMacrosCode() : \binary|null

Return the macros code

Returns

\binary|null —

setMacrosCertificate()

setMacrosCertificate(mixed  $Certificate = NULL) : mixed

Set the macros certificate

Parameters

mixed $Certificate

Returns

mixed —

hasMacrosCertificate()

hasMacrosCertificate() : true|false

Is the project signed ?

Returns

true|false —

getMacrosCertificate()

getMacrosCertificate() : \binary|null

Return the macros certificate

Returns

\binary|null —

discardMacros()

discardMacros() : void

Remove all macros, certificate from spreadsheet

setRibbonXMLData()

setRibbonXMLData(mixed  $Target = NULL, mixed  $XMLData = NULL) : mixed

set ribbon XML data

Parameters

mixed $Target
mixed $XMLData

Returns

mixed —

getRibbonXMLData()

getRibbonXMLData(mixed  $What = 'all') : mixed

retrieve ribbon XML Data

return string|null|array

Parameters

mixed $What

Returns

mixed —

setRibbonBinObjects()

setRibbonBinObjects(mixed  $BinObjectsNames = NULL, mixed  $BinObjectsData = NULL) : mixed

store binaries ribbon objects (pictures)

Parameters

mixed $BinObjectsNames
mixed $BinObjectsData

Returns

mixed —

getRibbonBinObjects()

getRibbonBinObjects(mixed  $What = 'all') : mixed

retrieve Binaries Ribbon Objects

Parameters

mixed $What

Returns

mixed —

hasRibbon()

hasRibbon() : true|false

This workbook have a custom UI ?

Returns

true|false —

hasRibbonBinObjects()

hasRibbonBinObjects() : true|false

This workbook have additionnal object for the ribbon ?

Returns

true|false —

sheetCodeNameExists()

sheetCodeNameExists(string  $pSheetCodeName) : bool

Check if a sheet with a specified code name already exists

Parameters

string $pSheetCodeName

Name of the worksheet to check

Returns

bool —

getSheetByCodeName()

getSheetByCodeName(string  $pName = '') : \PHPExcel_Worksheet

Get sheet by code name. Warning : sheet don't have always a code name !

Parameters

string $pName

Sheet name

Returns

\PHPExcel_Worksheet —

__construct()

__construct() : mixed

Create a new PHPExcel with one Worksheet

Returns

mixed —

__destruct()

__destruct() : mixed

Code to execute when this worksheet is unset()

Returns

mixed —

disconnectWorksheets()

disconnectWorksheets() : mixed

Disconnect all worksheets from this PHPExcel workbook object, typically so that the PHPExcel object can be unset

Returns

mixed —

getCalculationEngine()

getCalculationEngine() : \PHPExcel_Calculation

Return the calculation engine for this worksheet

Returns

\PHPExcel_Calculation —

getProperties()

getProperties() : \PHPExcel_DocumentProperties

Get properties

Returns

\PHPExcel_DocumentProperties —

setProperties()

setProperties(\PHPExcel_DocumentProperties  $pValue) : mixed

Set properties

Parameters

\PHPExcel_DocumentProperties $pValue

Returns

mixed —

getSecurity()

getSecurity() : \PHPExcel_DocumentSecurity

Get security

Returns

\PHPExcel_DocumentSecurity —

setSecurity()

setSecurity(\PHPExcel_DocumentSecurity  $pValue) : mixed

Set security

Parameters

\PHPExcel_DocumentSecurity $pValue

Returns

mixed —

getActiveSheet()

getActiveSheet() : \PHPExcel_Worksheet

Get active sheet

Returns

\PHPExcel_Worksheet —

createSheet()

createSheet(int|null  $iSheetIndex = NULL) : \PHPExcel_Worksheet

Create sheet and add it to this workbook

Parameters

int|null $iSheetIndex

Index where sheet should go (0,1,..., or null for last)

Throws

\PHPExcel_Exception

Returns

\PHPExcel_Worksheet —

sheetNameExists()

sheetNameExists(string  $pSheetName) : bool

Check if a sheet with a specified name already exists

Parameters

string $pSheetName

Name of the worksheet to check

Returns

bool —

addSheet()

addSheet(\PHPExcel_Worksheet  $pSheet, int|null  $iSheetIndex = NULL) : \PHPExcel_Worksheet

Add sheet

Parameters

\PHPExcel_Worksheet $pSheet
int|null $iSheetIndex

Index where sheet should go (0,1,..., or null for last)

Throws

\PHPExcel_Exception

Returns

\PHPExcel_Worksheet —

removeSheetByIndex()

removeSheetByIndex(int  $pIndex) : mixed

Remove sheet by index

Parameters

int $pIndex

Active sheet index

Throws

\PHPExcel_Exception

Returns

mixed —

getSheet()

getSheet(int  $pIndex) : \PHPExcel_Worksheet

Get sheet by index

Parameters

int $pIndex

Sheet index

Throws

\PHPExcel_Exception

Returns

\PHPExcel_Worksheet —

getAllSheets()

getAllSheets() : \PHPExcel_Worksheet[]

Get all sheets

Returns

\PHPExcel_Worksheet[] —

getSheetByName()

getSheetByName(string  $pName = '') : \PHPExcel_Worksheet

Get sheet by name

Parameters

string $pName

Sheet name

Returns

\PHPExcel_Worksheet —

getIndex()

getIndex(\PHPExcel_Worksheet  $pSheet) : \Sheet

Get index for sheet

Parameters

\PHPExcel_Worksheet $pSheet

Throws

\PHPExcel_Exception

Returns

\Sheet —

index

setIndexByName()

setIndexByName(string  $sheetName, int  $newIndex) : \New

Set index for sheet by sheet name.

Parameters

string $sheetName

Sheet name to modify index for

int $newIndex

New index for the sheet

Throws

\PHPExcel_Exception

Returns

\New —

sheet index

getSheetCount()

getSheetCount() : int

Get sheet count

Returns

int —

getActiveSheetIndex()

getActiveSheetIndex() : int

Get active sheet index

Returns

int —

Active sheet index

setActiveSheetIndex()

setActiveSheetIndex(int  $pIndex) : \PHPExcel_Worksheet

Set active sheet index

Parameters

int $pIndex

Active sheet index

Throws

\PHPExcel_Exception

Returns

\PHPExcel_Worksheet —

setActiveSheetIndexByName()

setActiveSheetIndexByName(string  $pValue = '') : \PHPExcel_Worksheet

Set active sheet index by name

Parameters

string $pValue

Sheet title

Throws

\PHPExcel_Exception

Returns

\PHPExcel_Worksheet —

getSheetNames()

getSheetNames() : string[]

Get sheet names

Returns

string[] —

addExternalSheet()

addExternalSheet(\PHPExcel_Worksheet  $pSheet, int|null  $iSheetIndex = null) : \PHPExcel_Worksheet

Add external sheet

Parameters

\PHPExcel_Worksheet $pSheet

External sheet to add

int|null $iSheetIndex

Index where sheet should go (0,1,..., or null for last)

Throws

\PHPExcel_Exception

Returns

\PHPExcel_Worksheet —

getNamedRanges()

getNamedRanges() : \PHPExcel_NamedRange[]

Get named ranges

Returns

\PHPExcel_NamedRange[] —

addNamedRange()

addNamedRange(\PHPExcel_NamedRange  $namedRange) : \PHPExcel

Add named range

Parameters

\PHPExcel_NamedRange $namedRange

Returns

\PHPExcel —

getNamedRange()

getNamedRange(string  $namedRange, \PHPExcel_Worksheet|null  $pSheet = null) : \PHPExcel_NamedRange|null

Get named range

Parameters

string $namedRange
\PHPExcel_Worksheet|null $pSheet

Scope. Use null for global scope

Returns

\PHPExcel_NamedRange|null —

removeNamedRange()

removeNamedRange(string  $namedRange, \PHPExcel_Worksheet|null  $pSheet = null) : \PHPExcel

Remove named range

Parameters

string $namedRange
\PHPExcel_Worksheet|null $pSheet

Scope: use null for global scope.

Returns

\PHPExcel —

getWorksheetIterator()

getWorksheetIterator() : \PHPExcel_WorksheetIterator

Get worksheet iterator

Returns

\PHPExcel_WorksheetIterator —

copy()

copy() : \PHPExcel

Copy workbook (!= clone!)

Returns

\PHPExcel —

__clone()

__clone() : mixed

Implement PHP __clone to create a deep clone, not just a shallow copy.

Returns

mixed —

getCellXfCollection()

getCellXfCollection() : \PHPExcel_Style[]

Get the workbook collection of cellXfs

Returns

\PHPExcel_Style[] —

getCellXfByIndex()

getCellXfByIndex(int  $pIndex) : \PHPExcel_Style

Get cellXf by index

Parameters

int $pIndex

Returns

\PHPExcel_Style —

getCellXfByHashCode()

getCellXfByHashCode(string  $pValue = '') : \PHPExcel_Style|false

Get cellXf by hash code

Parameters

string $pValue

Returns

\PHPExcel_Style|false —

cellXfExists()

cellXfExists(\PHPExcel_Style  $pCellStyle = null) : bool

Check if style exists in style collection

Parameters

\PHPExcel_Style $pCellStyle

Returns

bool —

getDefaultStyle()

getDefaultStyle() : \PHPExcel_Style

Get default style

Throws

\PHPExcel_Exception

Returns

\PHPExcel_Style —

addCellXf()

addCellXf(\PHPExcel_Style  $style) : mixed

Add a cellXf to the workbook

Parameters

\PHPExcel_Style $style

Returns

mixed —

removeCellXfByIndex()

removeCellXfByIndex(int  $pIndex) : mixed

Remove cellXf by index. It is ensured that all cells get their xf index updated.

Parameters

int $pIndex

Index to cellXf

Throws

\PHPExcel_Exception

Returns

mixed —

getCellXfSupervisor()

getCellXfSupervisor() : \PHPExcel_Style

Get the cellXf supervisor

Returns

\PHPExcel_Style —

getCellStyleXfCollection()

getCellStyleXfCollection() : \PHPExcel_Style[]

Get the workbook collection of cellStyleXfs

Returns

\PHPExcel_Style[] —

getCellStyleXfByIndex()

getCellStyleXfByIndex(int  $pIndex) : \PHPExcel_Style

Get cellStyleXf by index

Parameters

int $pIndex

Returns

\PHPExcel_Style —

getCellStyleXfByHashCode()

getCellStyleXfByHashCode(string  $pValue = '') : \PHPExcel_Style|false

Get cellStyleXf by hash code

Parameters

string $pValue

Returns

\PHPExcel_Style|false —

addCellStyleXf()

addCellStyleXf(\PHPExcel_Style  $pStyle) : mixed

Add a cellStyleXf to the workbook

Parameters

\PHPExcel_Style $pStyle

Returns

mixed —

removeCellStyleXfByIndex()

removeCellStyleXfByIndex(int  $pIndex) : mixed

Remove cellStyleXf by index

Parameters

int $pIndex

Throws

\PHPExcel_Exception

Returns

mixed —

garbageCollect()

garbageCollect() : mixed

Eliminate all unneeded cellXf and afterwards update the xfIndex for all cells and columns in the workbook

Returns

mixed —

getID()

getID() : string

Return the unique ID value assigned to this spreadsheet workbook

Returns

string —

_getExtensionOnly()

_getExtensionOnly(mixed  $ThePath) : mixed

return the extension of a filename. Internal use for a array_map callback (php<5.3 don't like lambda function)

Parameters

mixed $ThePath

Returns

mixed —