private function _writeDefinedNameBiff8($name, $formulaData, $sheetIndex = 0, $isBuiltIn = false)
	{
		$record = 0x0018;

		// option flags
		$options = $isBuiltIn ? 0x20 : 0x00;

		// length of the name, character count
		$nlen = PHPExcel_Shared_String::CountCharacters($name);

		// name with stripped length field
		$name = substr(PHPExcel_Shared_String::UTF8toBIFF8UnicodeLong($name), 2);

		// size of the formula (in bytes)
		$sz = strlen($formulaData);

		// combine the parts
		$data = pack('vCCvvvCCCC', $options, 0, $nlen, $sz, 0, $sheetIndex, 0, 0, 0, 0)
			. $name . $formulaData;
		$length = strlen($data);

		$header = pack('vv', $record, $length);

		return $header . $data;
	}
private function _writeDefinedNameBiff8($name, $formulaData, $sheetIndex = 0, $isBuiltIn = false)
	{
		$record = 0x0018;

		// option flags
		$options = $isBuiltIn ? 0x20 : 0x00;

		// length of the name, character count
		$nlen = PHPExcel_Shared_String::CountCharacters($name);

		// name with stripped length field
		$name = substr(PHPExcel_Shared_String::UTF8toBIFF8UnicodeLong($name), 2);

		// size of the formula (in bytes)
		$sz = strlen($formulaData);

		// combine the parts
		$data = pack('vCCvvvCCCC', $options, 0, $nlen, $sz, 0, $sheetIndex, 0, 0, 0, 0)
			. $name . $formulaData;
		$length = strlen($data);

		$header = pack('vv', $record, $length);

		return $header . $data;
	}
private function _writeDefinedNameBiff8 ( $ name , $ formulaData , $ sheetIndex = 0 , $ isBuiltIn = false ) { $ record = 0x0018 ; // option flags $ options = $ isBuiltIn ? 0x20 : 0x00 ; // length of the name, character count $ nlen = PHPExcel_Shared_String :: CountCharacters ( $ name ) ; // name with stripped length field $ name = substr ( PHPExcel_Shared_String :: UTF8toBIFF8UnicodeLong ( $ name ) , 2 ) ; // size of the formula (in bytes) $ sz = strlen ( $ formulaData ) ; // combine the parts $ data = pack ( 'vCCvvvCCCC' , $ options , 0 , $ nlen , $ sz , 0 , $ sheetIndex , 0 , 0 , 0 , 0 ) . $ name . $ formulaData ; $ length = strlen ( $ data ) ; $ header = pack ( 'vv' , $ record , $ length ) ; return $ header . $ data ; }
Write a DEFINEDNAME record for BIFF8 using explicit binary formula data

@param	string		$name			The name in UTF-8
@param	string		$formulaData	The binary formula data
@param	string		$sheetIndex		1-based sheet index the defined name applies to. 0 = global
@param	boolean		$isBuiltIn		Built-in name?
@return	string	Complete binary record data
Write a DEFINEDNAME record for BIFF8 using explicit binary formula data