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
9
votes
2 answers

PHPExcel Multiple Dropdown list that dependent

I am trying to set up multiple dropdowns in phpexcel that are dependent. Basically, when you select a value in a dropdown in a column A, it loads different content in the dropdown in column B. I am able to comfortably set up dropdown lists on cells.…
Mohamed Omar
  • 287
  • 1
  • 3
  • 11
9
votes
2 answers

How to freeze headers and a set of columns using PHPExcel

I want to freeze my page headers and columns like so: I can freeze my headers absolutely fine and dandy: $highestRowCount = $sheet->getHighestRow(); $highestColumnCount = $sheet->getHighestColumn(); $sheet->freezePane(…
Jimmyt1988
  • 20,466
  • 41
  • 133
  • 233
9
votes
2 answers

Reading spreadsheet using PHPExcel

I'm trying to upload a spreadsheet and read it into a MySQL database using PHPExcel. For .xlsx files it works fine but whenever I try to upload a .ods file it throws the error: PHP Fatal error: Call to a member function getNamespaces() on a…
baarkerlounger
  • 1,217
  • 8
  • 40
  • 57
9
votes
3 answers

How to load excel template and write to it in PHPExcel?

How do I load an Excel Template with PHPExcel and write to its cells and also insert images to cells dynamically?
user1894072
9
votes
4 answers

How to set active sheet without loading an xlsx file?

I am using PHPExcel to generate an xl using php. I am not loading an xl sheet but creating new sheets using $phpExcel = new PHPExcel(); $phpExcel->getActiveSheet()->setTitle("My Sheet"); I want to set active sheet using phpExcel using…
Simone
  • 636
  • 2
  • 8
  • 25
9
votes
1 answer

Workaround for copying style with PHPExcel

I want to copy the style information from cells to ranges, like Format Painter in Excel. The documentation says to do something like this: $activeSheet->duplicateStyle($activeSheet->getStyle('A1'),…
Alien Technology
  • 1,760
  • 1
  • 20
  • 30
9
votes
3 answers

Ignore empty cells PHPExcel

I'm using the library PHPExcel to read data in an Excel file. The problem I'm having, is that when I use something like: $obj = PHPExcel_IOFactory::load($file); $data = $obj->getActiveSheet()->toArray(null,true,true,true); To load my file and…
user765368
  • 19,590
  • 27
  • 96
  • 167
9
votes
5 answers

PHP Excel image change size

Developing PHP code that will create Excel file using PHP Excel. I need to place an image into XLS file. Problem I have is that dimension of the image are not the one I defined in my code: $objDrawing = new…
user198003
  • 11,029
  • 28
  • 94
  • 152
9
votes
1 answer

Create a table in spreadsheet with PHPExcel

In searching for an answer, I found lots of questions regarding turning a table into a spreadsheet, or outputting a spreadsheet into a table, but nothing about creating an Excel table within a spreadsheet with PHPExcel. I'd like to create a table…
Luke Shaheen
  • 4,262
  • 12
  • 52
  • 82
8
votes
4 answers

PHPExcel class not found in Zend Autoloader

I am struggling with namespaces in Zend Framework (at least I think it's a namespace issue). I want to integrate PHPExcel into my Zend project. Relevant file structure is as follows: / -library -ABCD -PHPExcel -Zend -ZendX …
yycroman
  • 7,511
  • 1
  • 19
  • 21
8
votes
2 answers

PHPExcel memory issue

I'm trying to loop through a 3mb Excel document, to get all the data I will then have to insert into the database. The worksheet I'm using has got 6500 rows, but it might vary in the future. I've noticed that even though I'm using recommended memory…
Kasia Gogolek
  • 3,374
  • 4
  • 33
  • 50
8
votes
5 answers

Why PHPExcel does not allow to write more than 5000 rows

Can any one please tell me Why PHPExcel does not allow more than 5000 rows. I am using an open-source PHPExcel for report generation on my projects and i could not write more than 5000 rows of data from Mysql-DB. My result set fetch 7230 records…
Prabhu M
  • 2,852
  • 8
  • 37
  • 54
8
votes
3 answers

Right way of validating xlsx files before database inserting

while playing with PHPExcel I came across some questions how properly handle validation/and inserting values into a database. I do not need any codes, just the general concept how to do it. Firstly I iterate through first row to check if the columns…
Kavvson Empcraft
  • 445
  • 7
  • 32
8
votes
3 answers

ZipArchive::close(): Failure to create temporary file in AWS EC2 Linux

I am working on cron jobs in laravel 5.2, when i try to call a controller function from schedule to create excel sheet getting Error. but runs fine in postman. ZipArchive::close(): Failure to create temporary: No such file or directory' in…
151291
  • 3,308
  • 7
  • 48
  • 81
8
votes
2 answers

How to convert to array with keys from first row by PHPExcel?

Sorry, cant find what i need. I have xls/xlsx. Then i get smth like this: array 0 => array 0 => string 'NameFirstColumn' 1 => string 'NameSecondColumn' 1 => array 0 => string 'qqq' 1 => float 30 2 => array 0…
Philipp Klemeshov
  • 383
  • 1
  • 5
  • 14