---
title: "excelOpenWorkbook"
canonical: "https://support.appfire.com/space/PSJC/1387266508/excelOpenWorkbook"
format: markdown
---
> Macro (aura-html)


## Description

> Macro (excerpt)
> 
> Opens a workbook so that it may be used in the script.

Opens a workbook so that it may be used in the script.

|  |  |  |  |
| --- | --- | --- | --- |
| **Syntax** | excelOpenWorkbook(path_to_excel_file) | **Package** | excel |
| **Alias** |  | **Pkg Usage** | openWorkbook(path_to_excel_file) |

## Parameters

| Parameter name | Type | Required | Description |
| --- | --- | --- | --- |
| path_to_excel_file | String | Yes | File path of the workbook to open. |

## Return Type

**Integer**

## Example

Opens a workbook, adds a new worksheet and then saves and closes the workbook.

```javascript
use "excel";
int fid = openWorkbook("snakes.xlsx");
addSheet(fid, "Venemous Snakes", true);
closeWorkbook(fid);
```

> ⚠️ Click [here](https://appfire.atlassian.net/wiki/pages/createpage.action?spaceKey=psjc&title=SIL%20Excel%20Routines&linkCreation=true&fromPageId=1387266508) to download the workbook used in this example.

## See also

> Macro (contentbylabel)