PHP code example of ribojhin / excelmacro

1. Go to this page and download the library: Download ribojhin/excelmacro library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ribojhin / excelmacro example snippets



  


  Ribojhin\Excelmacro;

  $excelMacro = new Excelmacro("_FILE_PATH_SRC_XLSM_");              // Set excel file path you want to edit
  $excelMacro->setSheet(0);                                         // Set sheet by index
  $excelMacro->setCellValue($excelMacro->getSheet(), "_KEY_", '_VALUE_'); // Set cell
  $excelMacro->save("_FILE_PATH_DEST_XLSM_");                        // Set destination file path