Schedule cron jobs using Ultimate Cron
Apparently cron api dosn't work with Drupal 8 at this time. What I did to fix my issue was to create one new module to handle only the cron job that I wanted. Then from the UI of Ultimate Cron I would add the rule to schedule my cron job.

use Drupal\MODULENAME\Controller\ClassName;

/**
 * Implements hook_cron().
 */
function NEW_MODULENAME_cron() {
 generate_excel_files_callback();
}

function generate_excel_files_callback(){
 $obj = new ClassName();
 $obj-&gt;generateXLSX();
}