PHPExcel: Как правильно использовать функцию insertNewRowBefore?

Я хочу добавить строки $ x после номера строки $ insert_here.

Это функция:

// Get the Excel file I want to work on: function get_excel_file(){ // Need to define this to change a global variable inside a function global $objPHPExcel; // Define an Exel Object to read files from: $objPHPExcel = PHPExcel_IOFactory::load('keywords.xlsx'); } // Inserts new rows: Gets the number of rows to insers them before the second variable function insert_rows( $objPHPExcel, $insert_here, $num_rows ){ echo $num_rows, $insert_here; $objPHPExcel->getActiveSheet()->insertNewRowBefore( $insert_here, $num_rows ); } 

При вызове функции я получаю хорошее эхо переменных. Поэтому я уверен, что это не переменные.

В чем проблема? Файл Excel выглядит точно так же, если не вставлены новые строки.