# Generate code to create Excel and CSV reports

### Why generate export code

Sometimes, you don't want to just download a snapshot of the current dataframe within Mito - you want to create code that takes one of these dataframes and saves it to a CSV or Excel file. This can be particularly useful if you're automating a full analysis within Mito.

### How to generate export code

1. Open the `Home` tab in the Mito toolbar.
2. Click the `Export` dropdown then select `Download File When Running Code`.
3. Change the `File Name` to the name of the file to save.&#x20;
4. Select the export format, either `CSV` or `Excel` files.
5. Select the dataframes you want to include in the export.&#x20;
   1. Note that if you select multiple dataframes when exporting as a CSV, Mito will automatically create distinct files for each.
6. Click the `Generate Export Code` button.&#x20;
   1. This saves the exported file to disk, and also generates code that will export a file with the same configuration as well.

<figure><img src="https://2294704369-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MP_U5ZCmiamDOXEOOTC%2Fuploads%2F7RYKcBwuhwXflhbxGovg%2FScreen%20Shot%202023-11-29%20at%203.40.52%20PM.png?alt=media&#x26;token=7aab7347-b707-4b44-9ea7-65882098bd76" alt=""><figcaption></figcaption></figure>
