# Setup O365 Excel using Microsoft account (oAuth)

This guide explains how to set up OAuth authentication for Office 365 Excel integration with Smaply.

### Recommended Approach

For enterprise use cases, we recommend using a [**Service Account**](/integrations/metrics-tools/office-365-excel/configuring-the-office-365-excel-integration/setup-service-account-for-o365-excel.md) instead of OAuth. Service Accounts provide more secure and scalable access to Office 365 data. However, if you prefer OAuth or have specific requirements, follow the steps below.

### Prerequisites

* A Microsoft Office 365 account with access to the required Excel files.
* Admin approval may be required for some organizations.

### OAuth Authentication Process

#### 1. Initiate OAuth Flow  (Account settings, Integrations).

<br>

<figure><img src="/files/tvrLV275lXSBME0gXPIT" alt=""><figcaption></figcaption></figure>

* Click the **Connect Office 365 Account** button in Smaply.
* You will be redirected to Microsoft's OAuth consent screen.

#### 2. Grant Permissions

* Sign in with your Microsoft Office 365 account.
* Review the permissions requested by Smaply:
  * **Read all files that you have access to**
  * **Sign you in and read your profile**
  * (Optional) **Consent on behalf of your organization**\
    \
    ![](/files/cUrRe8nRwxgxoaS1tJUN)
* Click **Accept** to grant access to your Office 365 data.

### Troubleshooting

**No Files Available:** \
&#x20;\- confirm that your Microsoft Office 365 account has access to at least one Excel file.\
\
**Authentication errors:**&#x20;

* Try clearing your browser cache and cookies, then restart the process.
* If problems persist, contact your Office 365 administrator to verify account permissions.
* OAuth tokens have an expiration period. Smaply will handle token refresh automatically, but ensure you don’t revoke the app’s permissions in your Microsoft account to maintain uninterrupted access.

If you need further assistance, reach out to Smaply support.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://helpdesk.smaply.app/integrations/metrics-tools/office-365-excel/configuring-the-office-365-excel-integration/setup-o365-excel-using-microsoft-account-oauth.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
