Questions tagged [phpexcel]

A PHP library to create, read, edit and write spreadsheet files for MS Excel and other spreadsheet programs

PHPExcel was a library written in pure PHP that provides methods to read workbook files generated by Excel and other spreadsheet programs (Excel 95 and higher .xls and .xlsx, Excel 2003 XML, Comma-Separated Value, SYLK, Gnumeric, and Open/Libre Office Calc .ods); to manipulate spreadsheet data and formatting; and to create/write to various formats (Excel BIFF8 .xls, Excel 2007 .xlsx, Comma-Separated Value, HTML, and PDF).

It is a component of the PHPOffice suite of libraries, comprising PHPExcel, PHPWord, PHPPowerPoint, PHPProject and PHPVisio.

The last production release of PHPExcel was version 1.8.1 in year 2015 via composer and git.

The final notice from PHPExcel is:

The project has not be maintained for years and must not be used anymore. All users must migrate to its direct successor PhpSpreadsheet, or another alternative.

Popular questions

Resources

Documentation

3639 questions
1
vote
1 answer

PhpExcel: remove all formatting from sheet

I am using the library PhpExcel to import data from Excel. I would like to remove all formatting from the spreadsheet so I can ready the values with the RangeToArray function. OR I'd like to read a range values but it seems that rangeToArray takes…
Sébastien
  • 5,263
  • 11
  • 55
  • 116
1
vote
1 answer

PHPExcel different styles in the same cell

Hello: I'm using PHPExcel in a project and need to apply different styles in the same cell. This is an example: example image as I can do? Thank you!
Ariel
  • 13
  • 2
1
vote
0 answers

Yii export to excel

extension https://github.com/hscstudio/yiiheart how do I export my data from sql query \ array? with the proviso that there is no data in the model. current state of affairs: public function actionExport() { $model = new Element; …
des1roer
  • 220
  • 1
  • 14
1
vote
1 answer

PHPExcel: How to get all column A in an array?

I have this code that I'm using to get all column A as a PHP array:
Imnotapotato
  • 5,308
  • 13
  • 80
  • 147
1
vote
0 answers

PHPExcel: moving whole column

I am wondering if it's possible to move whole column in PHPExcel. The case: I have xlsx file which needs to be validated (per row). Invalid cells need to be marked, comments should be added and so on. I want to add column which would indicate if row…
Wirone
  • 3,304
  • 1
  • 29
  • 48
1
vote
2 answers

PHPExcel exporting "corrupted" .xlsx file

I have a function in Laravel that allows the user to export reports from their application. So far exporting .csv is working fine, though when giving them the option to export out to .xlsx it throws an error about the extension not being…
Das
  • 470
  • 5
  • 20
1
vote
1 answer

is it possible to put bottom border of a merged cell in phpexcel?

$objectSheet->setCellValue($c[$current_col].$current_row, 'Civil Status:'); $objectSheet->mergeCells($c[$current_col].$current_row.':'.$c[$current_col + $width -1].$current_row); $current_col += $width; I want to put bottom border in the…
kev
  • 33
  • 1
  • 6
1
vote
2 answers

phpexcel setTitle function isn't handling á,é,í,ó,ú etc

Using Symfony2.3.4 and PHP5.6.3 and PHPExcel1.8.0 Is there a way to workaround this? See, when I call $objPHPExcel->getProperties() ->setCreator($creator) ->setLastModifiedBy($creator) ->setTitle($name); …
Scaramouche
  • 3,188
  • 2
  • 20
  • 46
1
vote
2 answers

Error Import Excel Date PHP

I have a problem trying to upload an excel to my database through PHP. The format I have in the excel is dd/mm/yyyy and my sql needs yyyy/mm/dd $_DATOS_EXCEL[$i]['ship_day']= $objPHPExcel->getActiveSheet()- >getCell($headings['Ship…
1
vote
0 answers

merge cells and apply style phpexel

When doing merge cells and applying style in loop script is giving fatal error mentioned below. Fatal error: Maximum execution time of 30 seconds exceeded in D:\xampp\htdocs\bookings\vendor\phpoffice\phpexcel\Classes\PHPExcel\Cell.php on line…
Amit Shah
  • 1,380
  • 1
  • 10
  • 19
1
vote
1 answer

PHPExcel borders being overridden?

I have a class that creates a PHPExcel document. Below are the styles I use. Hopefully they are fairly obvious from their names. private $default_style = array( 'font' => array( 'name' => 'Verdana', 'color' => array('rgb' =>…
Katrina
  • 1,922
  • 2
  • 24
  • 42
1
vote
0 answers

PHPExcel getCalculatedValue() returns wrong answer when cell contains formula with special characters in it

here is a piece of my code I'm having trouble with $where = "O".$i; $formula = '=IFERROR(IF(OR(C'.$i.'="výzva",C'.$i.'="string2"),E'.$i.'," ")," ")'; $objPHPExcel->getActiveSheet()->setCellValue($where,…
1
vote
1 answer

Creating a hyphen list inside a cell

I'm trying to figure out how I can insert a hyphen list into a cell with phpexcel like this: -Value A -Value B I tried it with following snippet: // input value can be something else $value = "-ValueA\n-Value B"; if (strpos($value, '-') === 0 ||…
bob4ever
  • 13
  • 3
1
vote
0 answers

PHPExcel write from template file, and maintain drop down and validation checks

I am trying to create an excel sheet using PHPExcel, modify the data in the excel sheet then download the modified data that I created into a template format i have stored on my server. I noticed that once I downloaded the sheet with data in it,…
1
vote
1 answer

PHPExcel Named Ranges not working with special characters in MS Office

I created a dependant dropdown lists as shown here. The problem is that the named ranges wont work with special characters like spaces, brackets, hyphen, etc (underscore works!) in MS Office but works fine in…
Sankalp Tambe
  • 400
  • 4
  • 15