How to Create Excel file from PHP with PHPExcel 1.8.0 Classes

create excel with php

To create an excel file using PHP needed a php class named PHPExcel 1.8.0. PHPExcel has been frequently discussed in php sites, whereas this article I would like to remind how easy create an excel file with php using a class from Balliauw Maarten and his team.

How to writing Excel file from PHP with PHPExcel 1.8.0 Classes

In addition to create an excel file, class PHPExcel can also be used to read the excel file. Specifically, this article will discuss how to create or writing an excel file using php.

 Advantages use PHPExcel 

1. Easy and simple to use.
2. Easy to setting the layout (color, background, border, etc.)
3. Easy to use functions in Excel

 Basic example using PHPExcel to create an excel file 

1. Download phpexcel class here
2. Create php file as create_excel.php.
3. Please copy PHPExcel.php in the same folder with create_excel.php.
4. Copy code below


With these code will create the detail file excel

writing detail file excel with phpexcel in php

To change color, border,font use this script below

Thus tutorial how to writing excel file with PHPExcel class in php. Next time i will show you how to create or writing function excel in php. My another php tutorial click here

The following two tabs change content below.
This site is a personal Blog of Sigit Prasetya Nugroho, a Desktop developer and freelance web developer working in PHP, MySQL, WordPress.


 Add your comment
  1. set password to open a file. is it possible

Leave a Comment Cancel reply

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.