Webform export to CSV programmatically
After looking at the drush webform-export code I came up with the following code sample. 
It appears to work, however jrockowitz advises me that using drush straight up should be the best solution. I'm sure there's something wrong with the following code. For one, it probably breaks when the export is too large. 

$webform_id = 'easykit_vip_formulier';
$webform = \Drupal\webform\Entity\Webform::load($webform_id);
$submission_exporter = \Drupal::service('webform_submission.exporter');
$export_options = $submission_exporter-&gt;getDefaultExportOptions();

$export_options['delimiter'] = ';';
$export_options['multiple_delimiter'] = ',';
$export_options['range_type'] = 'date';
$export_options['range_start'] = '2018-02-18';
$export_options['range_end'] = '2018-02-26';

$submission_exporter-&gt;setWebform($webform);
$submission_exporter-&gt;setExporter($export_options);
$submission_exporter-&gt;generate();
$file_path = $submission_exporter-&gt;getExportFilePath();

print file_get_contents($file_path);

unlink($file_path);