An Excel add-in for interacting with OpenAlgo trading API. This add-in provides custom functions to fetch and display trading account information directly in Excel.
OPENALGO.FUNDS()
- Fetches and displays fund details including:- Available Cash
- Collateral
- M2M Realized
- M2M Unrealized
- Utilised Debits
- Node.js (version 12 or higher)
- npm (comes with Node.js)
- Microsoft Excel (2016 or later)
-
Prepare the Manifest:
- Download the
manifest.production.xml
file - Rename it to
manifest.xml
(optional)
- Download the
-
Method 1: Centralized Deployment (Recommended for Organizations):
- Open Excel
- Go to
File
>Options
>Trust Center
>Trust Center Settings
- Select
Trusted Add-in Catalogs
- Add the catalog URL:
https://excel.openalgo.in
- Click OK and restart Excel
- Go to
Insert
>My Add-ins
>Shared Folder
- Select "OpenAlgo Excel Add-in"
-
Method 2: Manual Sideloading:
# Create the add-in directory if it doesn't exist $addInFolder = "$env:USERPROFILE\AppData\Local\Microsoft\Office\16.0\Wef" New-Item -ItemType Directory -Force -Path $addInFolder # Copy the manifest Copy-Item manifest.production.xml "$addInFolder\manifest.xml"
Then:
- Open Excel
- Go to
Insert
>My Add-ins
>OPENALGO
- Click to load the add-in
-
Method 3: Network Share:
- Place the manifest file on a network share
- Open Excel
- Go to
File
>Options
>Trust Center
>Trust Center Settings
- Click
Trusted Add-in Catalogs
- Add the network share path
- Click OK and restart Excel
- The add-in will appear in
Insert
>My Add-ins
-
Add-in Not Appearing:
- Verify manifest location:
dir "$env:USERPROFILE\AppData\Local\Microsoft\Office\16.0\Wef\manifest.xml"
- Check Excel version (must be 2016 or later)
- Clear Office cache:
Remove-Item "$env:USERPROFILE\AppData\Local\Microsoft\Office\16.0\Wef\*" -Force -Recurse Remove-Item "$env:USERPROFILE\AppData\Local\Microsoft\Office\16.0\WebExtCache\*" -Force -Recurse
- Verify manifest location:
-
Security Settings:
- Open Excel
- Go to
File
>Options
>Trust Center
>Trust Center Settings
- Enable:
Allow add-ins to start
Allow web add-ins to work on trusted documents
Turn on Preview Features
-
Network Issues:
- Ensure https://excel.openalgo.in is accessible
- Check your firewall settings
- Try using a different network connection
-
Reset if Nothing Works:
# Full reset of Office Add-in cache Stop-Process -Name "Excel" -Force -ErrorAction SilentlyContinue Remove-Item "$env:USERPROFILE\AppData\Local\Microsoft\Office\16.0\Wef\*" -Force -Recurse Remove-Item "$env:USERPROFILE\AppData\Local\Microsoft\Office\16.0\WebExtCache\*" -Force -Recurse
Then:
- Restart Excel
- Try installing the add-in again
Save this as install-addin.ps1
:
# Check if running as administrator
if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
{
Write-Warning "Please run as administrator"
exit
}
# Create directories
$wefPath = "$env:USERPROFILE\AppData\Local\Microsoft\Office\16.0\Wef"
New-Item -ItemType Directory -Force -Path $wefPath
# Copy manifest
Copy-Item manifest.production.xml "$wefPath\manifest.xml" -Force
# Clear cache
Remove-Item "$env:USERPROFILE\AppData\Local\Microsoft\Office\16.0\WebExtCache\*" -Force -Recurse -ErrorAction SilentlyContinue
Write-Host "Add-in installed successfully. Please restart Excel."
Run the script:
powershell -ExecutionPolicy Bypass -File install-addin.ps1
-
Create Add-in Directory:
mkdir -p ~/Library/Containers/com.microsoft.Excel/Data/Documents/wef
-
Copy Manifest:
- Copy the
manifest.xml
file to the wef directory - Make sure to use the production manifest that points to excel.openalgo.in
cp manifest.xml ~/Library/Containers/com.microsoft.Excel/Data/Documents/wef/
- Copy the
-
Open Excel:
- Launch Microsoft Excel
- Create a new workbook or open an existing one
- If Excel was already open, close and reopen it
-
Enable Add-in:
- Go to Excel > Preferences
- Click 'Security & Privacy'
- Check 'Trust access to the Office Add-ins platform'
- Click 'OK'
-
Access the Add-in:
- Go to the 'Insert' tab
- Click 'My Add-ins' (Office Add-ins)
- Look for "OpenAlgo" in the list
- Click to load the add-in
-
Using the Add-in:
- The taskpane will open on the right
- Enter your API configuration
- Use the
OPENALGO.FUNDS()
function in any cell
If the add-in doesn't appear:
-
Verify the manifest.xml is in the correct location:
ls ~/Library/Containers/com.microsoft.Excel/Data/Documents/wef/manifest.xml
-
Check manifest.xml content:
- Ensure all URLs point to https://excel.openalgo.in/
- Verify there are no localhost URLs
-
Excel Security:
- Excel > Preferences > Security & Privacy
- Ensure all required permissions are granted
-
Clear Office Cache:
rm -rf ~/Library/Containers/com.microsoft.Excel/Data/Library/Caches/*
-
Restart Excel:
- Completely close Excel
- Reopen Excel
- Try loading the add-in again
- Open the add-in taskpane in Excel
- Enter your OpenAlgo API credentials:
- API Host (e.g., http://127.0.0.1:5000)
- API Key
After configuration, you can use the following functions in Excel:
=OPENALGO.FUNDS()
This will return a table with your account's fund details.
During development, the add-in runs on a local server:
npm start
This starts a development server at https://localhost:3000
For production use, you have several options:
a) Static Web Hosting:
- Build the project:
npm run build
- Deploy the
dist
folder to any static web hosting service:- Azure Static Web Apps
- GitHub Pages
- Netlify
- Vercel
- AWS S3 + CloudFront
- Update the manifest.xml with your production URLs
- Share the updated manifest with users
b) SharePoint Deployment:
- Deploy to SharePoint for organizational use
- Use SharePoint's built-in HTTPS
- Centralized distribution via Microsoft 365 admin center
c) Office Add-in Store:
- Package the add-in
- Submit to the Office Store
- Users can install directly from Excel's Add-in store
For enterprise deployment:
- Build the production version:
npm run build
- Deploy to your hosting solution
- Update manifest.xml with production URLs
- Use Microsoft 365 admin center to deploy to your organization
- Users will automatically get the add-in in Excel
To publish your add-in to the Office Store:
-
Prepare Your Hosting:
- Build your add-in:
npm run build
- Deploy the built files to a web hosting service with HTTPS
- Common options:
- Azure Static Web Apps (recommended)
- Azure Web Apps
- AWS S3 + CloudFront
- Any web host with HTTPS support
- Build your add-in:
-
Update Manifest:
- Update manifest.xml with your production URLs
- Ensure all URLs use HTTPS
- Example:
<SourceLocation DefaultValue="https://your-domain.com/taskpane.html"/>
-
Submit to Office Store:
- Go to Partner Center
- Create a new submission
- Upload your manifest
- Provide store listing details (descriptions, screenshots, etc.)
- Submit for validation
-
After Approval:
- Your add-in appears in Excel's Add-in store
- Users can install with a few clicks
- No need for manual manifest deployment
- Updates are handled through the store
The server hosting your add-in files needs to be maintained, but users don't need to run any local servers - they just install from Excel's Add-in store and your hosted files are served from your production server.
For more details on deployment options, see Office Add-ins deployment guide.
-
Prerequisites:
- Install Vercel CLI:
npm i -g vercel
- Have a Vercel account
- Own the domain (excel.openalgo.in)
- Install Vercel CLI:
-
Deploy to Vercel:
# Login to Vercel if not already logged in vercel login # Deploy to Vercel (this will automatically run the build) vercel # After testing in preview URL, deploy to production vercel --prod
-
What Happens During Deployment:
- Vercel detects the project as a Node.js project
- Runs
npm run build
automatically (configured in vercel.json) - Builds the project and creates the dist directory
- Serves files from the dist directory
-
Configure Custom Domain:
- Go to your Vercel project settings
- Navigate to "Domains"
- Add domain:
excel.openalgo.in
- Follow Vercel's instructions to configure DNS settings
- Wait for DNS propagation
-
Verify Deployment:
- Visit https://excel.openalgo.in/taskpane.html
- Ensure all assets load correctly
- Test the add-in using the updated manifest.xml
-
Automatic Deployments:
- Connect your GitHub repository to Vercel
- Each push to main will trigger:
- A fresh build of the project
- Deployment of the built files
- Preview deployments for pull requests
Note: The manifest.xml has been updated to use https://excel.openalgo.in/. Make sure your domain is properly configured before submitting to the Office Store.
When deploying to production, you need to host the following files from your dist
folder:
-
Required Files:
dist/ ├── taskpane.html # Main UI ├── taskpane.js # UI functionality ├── functions.js # Excel functions ├── functions.json # Function metadata ├── polyfill.js # Browser compatibility ├── *.css # Styles └── assets/ # Icons ├── icon-16.png ├── icon-32.png ├── icon-64.png ├── icon-80.png └── icon-128.png
-
Optional Files (for debugging):
- Source maps (*.map files)
- License files (*.LICENSE.txt)
-
Do Not Host:
manifest.xml
- This is used for add-in registration, not hosted- Source files from
src/
directory - Development files (package.json, webpack.config.js, etc.)
To deploy:
- Run
npm run build
to generate thedist
folder - Upload all required files to your web host
- Maintain the same file structure as in the
dist
folder - Ensure all files are served with correct MIME types
- Enable HTTPS for all files
npm start
- Starts the development servernpm run build
- Builds the production versionnpm run lint
- Runs lintingnpm test
- Runs tests
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Office Add-ins Framework