\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 : array<mixed,\PHPExcel_Worksheet>

Collection of Worksheet objects

Type

array<mixed,\PHPExcel_Worksheet>

$_calculationEngine

$_calculationEngine : \PHPExcel_Calculation

Calculation Engine

Type

\PHPExcel_Calculation

$_activeSheetIndex

$_activeSheetIndex : integer

Active sheet index

Type

integer

$_namedRanges

$_namedRanges : array<mixed,\PHPExcel_NamedRange>

Named ranges

Type

array<mixed,\PHPExcel_NamedRange>

$_cellXfSupervisor

$_cellXfSupervisor : \PHPExcel_Style

CellXf supervisor

Type

\PHPExcel_Style

$_cellXfCollection

$_cellXfCollection : array<mixed,\PHPExcel_Style>

CellXf collection

Type

array<mixed,\PHPExcel_Style>

$_cellStyleXfCollection

$_cellStyleXfCollection : array<mixed,\PHPExcel_Style>

CellStyleXf collection

Type

array<mixed,\PHPExcel_Style>

$_hasMacros

$_hasMacros : boolean

_hasMacros : this workbook have macros ?

Type

boolean

$_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(  $hasMacros = false) 

Define if a workbook has macros

Parameters

$hasMacros

setMacrosCode()

setMacrosCode(  $MacrosCode) 

Set the macros code

Parameters

$MacrosCode

getMacrosCode()

getMacrosCode() : \binary|null

Return the macros code

Returns

\binary|null

setMacrosCertificate()

setMacrosCertificate(  $Certificate = NULL) 

Set the macros certificate

Parameters

$Certificate

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(  $Target = NULL,   $XMLData = NULL) 

set ribbon XML data

Parameters

$Target
$XMLData

getRibbonXMLData()

getRibbonXMLData(  $What = 'all') 

retrieve ribbon XML Data

return string|null|array

Parameters

$What

setRibbonBinObjects()

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

store binaries ribbon objects (pictures)

Parameters

$BinObjectsNames
$BinObjectsData

getRibbonBinObjects()

getRibbonBinObjects(  $What = 'all') 

retrieve Binaries Ribbon Objects

Parameters

$What

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) : boolean

Check if a sheet with a specified code name already exists

Parameters

string $pSheetCodeName

Name of the worksheet to check

Returns

boolean

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() 

Create a new PHPExcel with one Worksheet

__destruct()

__destruct() 

Code to execute when this worksheet is unset()

disconnectWorksheets()

disconnectWorksheets() 

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

getCalculationEngine()

getCalculationEngine() : \PHPExcel_Calculation

Return the calculation engine for this worksheet

Returns

\PHPExcel_Calculation

getActiveSheet()

getActiveSheet() : \PHPExcel_Worksheet

Get active sheet

Throws

\PHPExcel_Exception

Returns

\PHPExcel_Worksheet

createSheet()

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

Create sheet and add it to this workbook

Parameters

integer|null $iSheetIndex

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

Throws

\PHPExcel_Exception

Returns

\PHPExcel_Worksheet

sheetNameExists()

sheetNameExists(string  $pSheetName) : boolean

Check if a sheet with a specified name already exists

Parameters

string $pSheetName

Name of the worksheet to check

Returns

boolean

addSheet()

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

Add sheet

Parameters

\PHPExcel_Worksheet $pSheet
integer|null $iSheetIndex

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

Throws

\PHPExcel_Exception

Returns

\PHPExcel_Worksheet

removeSheetByIndex()

removeSheetByIndex(integer  $pIndex) 

Remove sheet by index

Parameters

integer $pIndex

Active sheet index

Throws

\PHPExcel_Exception

getSheet()

getSheet(integer  $pIndex) : \PHPExcel_Worksheet

Get sheet by index

Parameters

integer $pIndex

Sheet index

Throws

\PHPExcel_Exception

Returns

\PHPExcel_Worksheet

getAllSheets()

getAllSheets() : array<mixed,\PHPExcel_Worksheet>

Get all sheets

Returns

array<mixed,\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, integer  $newIndex) : \New

Set index for sheet by sheet name.

Parameters

string $sheetName

Sheet name to modify index for

integer $newIndex

New index for the sheet

Throws

\PHPExcel_Exception

Returns

\New —

sheet index

getSheetCount()

getSheetCount() : integer

Get sheet count

Returns

integer

getActiveSheetIndex()

getActiveSheetIndex() : integer

Get active sheet index

Returns

integer —

Active sheet index

setActiveSheetIndex()

setActiveSheetIndex(integer  $pIndex) : \PHPExcel_Worksheet

Set active sheet index

Parameters

integer $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() : array<mixed,string>

Get sheet names

Returns

array<mixed,string>

addExternalSheet()

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

Add external sheet

Parameters

\PHPExcel_Worksheet $pSheet

External sheet to add

integer|null $iSheetIndex

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

Throws

\PHPExcel_Exception

Returns

\PHPExcel_Worksheet

getNamedRanges()

getNamedRanges() : array<mixed,\PHPExcel_NamedRange>

Get named ranges

Returns

array<mixed,\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() 

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

getCellXfCollection()

getCellXfCollection() : array<mixed,\PHPExcel_Style>

Get the workbook collection of cellXfs

Returns

array<mixed,\PHPExcel_Style>

getCellXfByIndex()

getCellXfByIndex(integer  $pIndex) : \PHPExcel_Style

Get cellXf by index

Parameters

integer $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) : boolean

Check if style exists in style collection

Parameters

\PHPExcel_Style $pCellStyle

Returns

boolean

getDefaultStyle()

getDefaultStyle() : \PHPExcel_Style

Get default style

Throws

\PHPExcel_Exception

Returns

\PHPExcel_Style

addCellXf()

addCellXf(\PHPExcel_Style  $style) 

Add a cellXf to the workbook

Parameters

\PHPExcel_Style $style

removeCellXfByIndex()

removeCellXfByIndex(integer  $pIndex) 

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

Parameters

integer $pIndex

Index to cellXf

Throws

\PHPExcel_Exception

getCellXfSupervisor()

getCellXfSupervisor() : \PHPExcel_Style

Get the cellXf supervisor

Returns

\PHPExcel_Style

getCellStyleXfCollection()

getCellStyleXfCollection() : array<mixed,\PHPExcel_Style>

Get the workbook collection of cellStyleXfs

Returns

array<mixed,\PHPExcel_Style>

getCellStyleXfByIndex()

getCellStyleXfByIndex(integer  $pIndex) : \PHPExcel_Style

Get cellStyleXf by index

Parameters

integer $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) 

Add a cellStyleXf to the workbook

Parameters

\PHPExcel_Style $pStyle

removeCellStyleXfByIndex()

removeCellStyleXfByIndex(integer  $pIndex) 

Remove cellStyleXf by index

Parameters

integer $pIndex

Throws

\PHPExcel_Exception

garbageCollect()

garbageCollect() 

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

getID()

getID() : string

Return the unique ID value assigned to this spreadsheet workbook

Returns

string

_getExtensionOnly()

_getExtensionOnly(  $ThePath) 

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

Parameters

$ThePath