6.1 Importing from Excel
Importing Excel Data using the Excel Data Connector Dialog
Data Connectors are a relatively new general import mechanism. From Origin 2021b, the Import Excel toolbar button has been re-coded to use the Excel Connector, in place of the older impMSExcel routine.
To open Excel Connector,
- With a worksheet active, choose Data: Connect to File: Excel; or click the Import Excel button
on the Import toolbar at the top of the workspace.
- If your Excel file has multiple sheets, specify one Excel Sheet (you will have the chance to connect additional sheets after the connection is made), or <All> sheets to connect.
- Header Lines
- The Auto box is checked for Main header lines, by default. Header lines will be added to a File Header label row.
- If you clear Auto and enter the number of Main header lines, an additional Save file header to drop-down is added to the dialog. Use this to specify saving header info to the Worksheet label area or the Book organizer.
- When sub-header lines are detected, the Column Labels box is checked and Long Name and Units rows are automatically specified. To manually specify the location of Column Labels, including Comments From and Comments To, edit the accompanying combo boxes.
- For partial import,
check Partial Import and enter ranges for Column and Row following the in-dialog examples or by referring to the Custom syntax outlined in this table. - If Excel file has formula calculated cells,
check Import Raw Formalu check box to import with Excel formula. Otherwise the result values will be imported directly. Note that some Excel formula are different/missing in Origin, which will return "#NAME?" (missing value). See Excel and Origin Functions Comparison for reference. - Other Options dialog
- To add sparklines on import, click the Other Options button (to the left of OK) and select a radio button. To disable sparklines on import, set @IMPS = 0.
- To run LabTalk scripts after import for post-processing, click the Other Options button and enter the scripts in the Post Import LabTalk Script edit box.
- If your import Excel file has "merged data cells":
- For merged cells in the label rows that are designated as Comments in Excel Import Options, (1) vertically-merged values are imported as one value; (2) horizontally-merged values are duplicated across merged cells.
- Merged cells in the data area (3) are not kept; merged cell values will be duplicated across merged cells.
To import more sheets after import,
- If you choose to import one sheet during import, after the file is imported, you can Add and Connect Sheet(s) to add other sheets in your Excel file using the the Data Navigator panel. Note that you can select multi-sheet in the Data Navigation to import them at once.
About Drag-n-Drop import...
- Drag-n-Drop to import an Excel file will use the <last used> settings in the Options dialog. So if your Excel file has multi-sheet and you choose to import <All>, then later you can use D&D to import all sheets in a new file. If you choose to import one sheet and later import by D&D, the same sheet will be imported. If the new file doesn't have such sheet name, first sheet will be imported.
Importing Excel Data using the impMSExcel X-Function Dialog
Beginning with Origin 2021b, clicking the Import Excel button |
To import an Excel file:
- Select Data: Import from File: Excel (XLS, XLSX, XLSM)..., or click the Import Excel button
located in the Standard toolbar. This opens the Excel dialog box. - Add your files one at a time or press CTRL or SHIFT to select multiple files, and click Add File(s). After choosing all the files, click the OK button. For more information about this setting, please see below.
- Make necessary adjustments in the impMSExcel dialog box, then click the OK button to import the files into Origin.
Additional Excel dialog box controls
- Use the Remove File(s) button to remove selected files from the import file list.
- Click the buttons (see the picture below) over the import file list to sort the files by File Name, Size or Modified date.
- Origin opens a secondary dialog box -- the impMSExcel dialog box -- when you click the OK button.
To re-import one or multiple Excel sheets:
From Origin 2015, you are allowed to re-import multiple sheets from Excel to Origin. During Excel re-importing, a link is maintained so that Origin is able to use up-to-date data.
To re-import Excel files, go to Data: Re-Import Directly or use Ctrl+4 keys to re-import Excel sheets with same settings as before. Or you can go to File: Re-Import... to bring up dialog box to change import settings for files to be re-imported.
You can also type command reimport -d in command window to re-import Excel files.
One advantage of the Excel Connector (and Data Connectors, in general) is that it can be automatically configured to update your project upon data changes in the connected Excel file. See Working with Microsoft Excel for information. |
The impMSExcel dialog box allows more controls over the way in which .XLS or .XLSX or .XLSM files are imported:
| File Name |
The File Name box lists all the files that have been chosen in the Excel dialog. Note that you can click the Browse button to the right to re-select your files. |
|---|---|
| File Info |
Node gives file size and sheet structure of selected excel file(s):
|
| 1st File Import Mode |
Import mode for the first file to be imported. Choose from:
|
| Multi-File (except 1st) Import Mode |
Import Mode for files after the first file. Choose from:
|
| Template Name |
For data import, a workbook template (*.otw) or an analysis template (*.ogw) can be used. Select a template from the list, or click the browse button.
Note: when importing a multi-sheets Excel book into the specified workbook template which contains empty worksheet(s), you can refer to system variable @ISE for additional control over importing behavior. |
| Column Designations |
Apply Origin column plot designations to imported Excel workbook data. Make a selection from the drop-down list, or type the designation directly. This option supports the column designation syntax (such as repeat designations) same as Import Wizard. You can refer to this page for more details. Note: the specified column designation will be applied to all sheets automatically. |
| Add Sparklines |
Add sparklines for the data:
|
| Import Cell Formats |
Specify whether to import cell formats (text color, font, cell height, .etc) in the Excel file. |
| Maximum Number of Empty Columns (-1 for all) |
Specify the maximum number of empty columns that will be imported into Origin. |
| Exclude Empty Sheets |
Specify whether input the empty sheets into target window. If it is chekced, empty sheets will not appear in the File Sheet(s) branch under the File Info branch. |
| Apply Header to All Sheets |
Specify whether apply the header settings in the Header Lines branch to all Excel sheets. |
| (Re)Naming Worksheet and Workbook |
Specify how to rename the worksheet and workbook.
|
| Header Lines |
Use these branch to specify which rows, if any, should be supply Origin worksheet column Long Name, Unit and Comment. The Number of Main Header Lines and Number of Subheader Lines can be specified too.
|
| Partial Import | Select columns and/or rows to import by specifying a regularly repeating pattern; or use Custom and the notation listed in Partial Import and Re-import to select columns for import. Note that for columns or rows, specifying To = 0 means "read to the end."
For Custom, see Partial Import and Re-import for the notation used to specify data range selection. |
| Scripts |
Third branch Script is used to specify the LabTalk scripts to be run after file(s) being imported.
|


