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


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

## 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.

## Parameters

| Parameter name | Type | Required | Description |
| --- | --- | --- | --- |
| id | Integer | Yes | The id. |

## 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/spaces/PSJ/pages/15483208) to download the workbook used in this example.

## See also

> Macro (contentbylabel)