# Open and Save Files

A tutorial showing how to open and save XLSX, CSV, and SSJSON files in the stand-alone SpreadJS Designer

## Content

You can open and save existing Excel-formatted (.xlsx, .xltx, .xlsm, .xltm), comma-delimited (.csv), and Spread files (.ssjson) files. Alternatively, if you want to set options for how the Designer imports the content from these files, you can choose to import them.
While saving files, SpreadJS remembers the sheet view position whenever a workbook is saved. Just like in Excel, the next time you open the same workbook, it will automatically scroll to the position where you left off previously before saving it. This feature uses the top left cell of the worksheet to keep the sheet view position intact when users save a workbook. For example - Let's say the top left cell was A10 when you saved your workbook for the last time. Now, when a user opens the same workbook again, the sheet will automatically be scrolled to have that cell (A10) at the top left position.

## Open and Import Files

**To open a new file,** click **File**, then choose **New**. In the **New** dialog, click on **Blank** to open a new spreadsheet.

![image](https://cdn.mescius.io/document-site-files/images/7719ad0a-f083-46d7-aff6-f63e2e187c15/image.4e51cc.png?width=750)

**To open an existing file,** click **Open** in the toolbar. In the **Open** dialog, browse to find the file you want to open. You can restrict the type of files displayed as you browse by choosing a file type from the drop-down list.
However, if you click **File** and then choose **Open**, it will only allow you to open an existing SpreadJS file.

![image](https://cdn.mescius.io/document-site-files/images/7719ad0a-f083-46d7-aff6-f63e2e187c15/image.0d38a5.png?width=750)

**To import an existing file** and choose settings for how it is imported, click **File**, then choose **Import**. On the **Import** menu page, choose the type of file you want to import, then specify the settings for importing your file. Additionally, if you want to convert sheet tables to data tables you have to enable the Convert Sheet Tables to Data Tables option.
![image](https://cdn.mescius.io/document-site-files/images/7719ad0a-f083-46d7-aff6-f63e2e187c15/image.bb5893.png?width=750)
While importing Excel files, choose the required file format (.xlsx, .xltx, .xlsm, .xltm) from the format selection dropdown.
![image](https://cdn.mescius.io/document-site-files/images/7719ad0a-f083-46d7-aff6-f63e2e187c15/image.177143.png?width=750)

>type=note
> **Notes:**
>
> * Macros cannot be viewed, edited, or executed within SpreadJS. All changes apply only to workbook data, not the macro code.
> * Changing worksheet layouts in SpreadJS may affect macro logic that references specific cell addresses.

## Save and Export Files

When you are finished editing the spreadsheet you have opened or created, you can save the spreadsheet to Spread file format (.ssjson), to an Excel format, or to a comma-delimited (.csv) file. The files you save in these formats can be re-opened by the SpreadJS Designer or loaded into the SpreadJS widget in your application.

>type=note
> **Note:**
> Macros are **not retained** if you save/export as `.xlsx` or SpreadJS internal formats (`.sjs`, `.ssjson`).

**To save your spreadsheet,** click **Save** in the toolbar. In the **Save** dialog, browse to find the path you want to save your file to, specify its name, and set its type.
However, if you click **File** and choose **Save**, it will only allow you to save the spreadsheet as a SpreadJS file.
![image](https://cdn.mescius.io/document-site-files/images/7719ad0a-f083-46d7-aff6-f63e2e187c15/image.5b63bb.png?width=750)

You can use the **Save** option to save to a JavaScript (.js) file. This file type can only be loaded with the [fromJSON](/spreadjs/api/classes/GC.Spread.Sheets.Worksheet#fromJSON) method.
You can export your spreadsheet to Spread file (.ssjson), Excel (.xlsx), comma-delimited (.csv), Portable Document Format (.pdf), or JavaScript (.js) format. When you choose to export, you can specify options about how the spreadsheet is exported.
**To export your spreadsheet,** click **File**, then choose **Export**. In the **Export** menu page, choose the type of file you want to export to, then specify the settings for exporting your file from **Excel File** section. If you want to export the data table binding, for example, you can enable the **Include Binding Source** option to save the binding source to the exported file.
![image](https://cdn.mescius.io/document-site-files/images/7719ad0a-f083-46d7-aff6-f63e2e187c15/image.96133b.png?width=750)
While exporting to Excel, choose the required file format (.xlsx, .xltx, .xlsm, .xltm) from the format selection dropdown.
![image](https://cdn.mescius.io/document-site-files/images/7719ad0a-f083-46d7-aff6-f63e2e187c15/image.91b9e2.png?width=750)

>type=warning
> **Warning:**
> Macros can distribute malware, so Excel marks macro-enabled files from the internet as untrustworthy. When opening a macro-workbook exported from SpreadJS in Excel, **enable macros first**; otherwise, they won't work. For details, see: [Internet macros blocked by default | Microsoft Learn](https://learn.microsoft.com/en-us/microsoft-365-apps/security/internet-macros-blocked "https://learn.microsoft.com/en-us/microsoft-365-apps/security/internet-macros-blocked").