ballerinax/microsoft.excel Ballerina library

2.3.0

Overview

Ballerina connector for Microsoft Excel connects the Microsoft Graph Excel API via Ballerina. It provides the capability to perform CRUD (Create, Read, Update, and Delete) operations on Excel workbooks stored in a Microsoft OneDrive.

This module supports Microsoft Graph API v1.0 version and only allows to perform functions behalf of the currently logged in user.

Prerequisites

Before using this connector in your Ballerina application, complete the following:

  1. Create a Microsoft Office 365 account
  2. Obtain tokens
    Follow the steps here

Quickstart

To use the Microsoft Excel connector in your Ballerina application, update the .bal file as follows:

Step 1: Import connector

Import the ballerinax/microsoft.excel module into the Ballerina project.

Copy
import ballerinax/microsoft.excel;

Step 2: Create a new connector instance

Create an excel:ConnectionConfig with the OAuth2 tokens obtained and initialize the connector with it.

Copy
excel:ConnectionConfig configuration = {
    auth: {
        refreshUrl: <REFRESH_URL>,
        refreshToken : <REFRESH_TOKEN>,
        clientId : <CLIENT_ID>,
        clientSecret : <CLIENT_SECRET>
    }
};

excel:Client excelClient = check new (configuration);

Step 3: Invoke connector operation

  1. Now you can use the operations available within the connector. Note that they are in the form of remote operations.
    Following is an example on how to add a worksheet using the connector.

    Copy
    public function main() returns error? {
        excel:Worksheet response = check excelClient->addWorksheet("workbookIdOrPath", "sheetName");
    }
  2. Use bal run command to compile and run the Ballerina program.

You can find a list of samples here

Import

import ballerinax/microsoft.excel;Copy

Metadata

Released date: over 1 year ago

Version: 2.3.0

License: Apache-2.0


Compatibility

Platform: any

Ballerina version: 2201.2.1

GraalVM compatible: Yes


Pull count

Total: 1866

Current verison: 190


Weekly downloads


Source repository


Keywords

Productivity/Spreadsheets

Cost/Free

Vendor/Microsoft


Contributors

Other versions

See more...