Create Workbook
Creates a new Excel workbook in OneDrive. The workbook is created with a default empty worksheet.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
info
If the ContinueOnError property is set to true, no error is caught when the project is executed even if a Catch node is used.
Input
- Client Id - The client ID from the Connect node (optional if using direct credentials).
- Workbook Name - Name for the new workbook file. The
.xlsxextension is automatically added if not provided. - Folder Path - OneDrive folder path where the workbook will be created. Use
/for root, or paths like/Documentsor/Reports.
Options
- Credentials - OAuth2 credentials (optional, alternative to using Client ID).
Output
-
Workbook Info - Object containing the created workbook's metadata:
Id: Workbook ID (use this with other Excel nodes)Name: File nameSize: File size in bytesWebUrl: URL to open file in Excel OnlineLastModifiedDateTime: When file was last modifiedCreatedDateTime: When file was createdMimeType: File MIME typeFolderPath: Where the file was created
-
Workbook Id - The workbook ID to use with other Excel nodes.
Examples
Create Workbook in Root:
// Input
Client Id: ${client_id}
Workbook Name: "Monthly Report"
Folder Path: "/"
// Output - workbook_id
"01ABC123DEF456GHI789"
// A file named "Monthly Report.xlsx" is created in OneDrive root
Create Workbook in Specific Folder:
// Input
Workbook Name: "Sales Data.xlsx"
Folder Path: "/Documents/Reports"
// Creates file at: /Documents/Reports/Sales Data.xlsx
Create and Populate Workbook:
Create Workbook
→ Get Worksheet (get default sheet)
→ Set Cell Value (add headers)
→ Set Range (add data)
→ Save changes (automatic via Graph API)
Use Cases
- Generate new reports programmatically
- Create Excel files for data export
- Set up template workbooks with initial structure
- Automate report generation workflows
- Create timestamped backup files
Tips
- The
.xlsxextension is automatically added if you don't include it - The workbook is created with one empty worksheet named "Sheet1"
- After creation, use Create Worksheet to add more sheets if needed
- The file is immediately available in OneDrive - no need to save manually
- If a file with the same name exists, it will be overwritten
- Store the Workbook Id output for all subsequent operations on this file
Common Errors
ErrInvalidArg - "Workbook name cannot be empty"
- Solution: Provide a name for the new Excel file
ErrGraph - "Microsoft Graph Error"
- Solution: Verify the folder path exists and you have write permissions
ErrInternal - "Error creating workbook"
- Solution: Check that the folder path is valid and accessible