PHPExcel in Drupal 7 I'm trying to export my Webform settings to an Excel file by using the PHPExcel module, but it looks like it's documentation isn't modified for Drupal 7...

When trying to define the two-dimensional array $data[row][column] (as mentioned in the API), I keep stumbling upon an errors...

I try to add "John Doe" in Cell A1, "john@example.com" in Cell B1, etc.

$data = array(
    1 =&gt; array(
        'A' =&gt; 'John Doe',
        'B' =&gt; 'john@example.com'
    ),
    1 =&gt; array(
        'A' =&gt; 'Jane Doe',
        'B' =&gt; 'jane@example.com'
    ),
  );


But nothing ends up in the Excel file. Sometimes the first letter, but nothing more...
What does this module require as $data?
The data table shold look like this:

 $data = array
    (
        array("Volvo",22,18),
        array("BMW",15,13),
        array("Saab",5,2),
        array("Land Rover",17,15)
    );


And whole working example will look like this:

function hoook_export_excel() {
    module_load_include('inc', 'phpexcel');
    $data = array();
    $headers = array();
    // First worksheet
    // Get the nodes
    $data = array
    (
        array("Volvo",22,18),
        array("BMW",15,13),
        array("Saab",5,2),
        array("Land Rover",17,15)
    );

    $headers = array("CAR","COUNT1","COUNT2");

    // Store the file in sites/default/files
    $dir = file_stream_wrapper_get_instance_by_uri('public://')-&gt;realpath();
    $filename = 'export1.xls';
    $path = "$dir/$filename";
    // Use the .xls format
    $options = array('format' =&gt; 'xls');
    $result = phpexcel_export($headers, $data, $path, $options);
    if ($result == PHPEXCEL_SUCCESS) {
        drupal_set_message(t("Ok"));
    }
    else {
        drupal_set_message(t("Error"), 'error');
    }
}


This will return Excel: