Back to Integrations

Microsoft Excel Integration

Use =DIVV() in Excel with our VBA module

🎉

Track Prices & Dividends for Free. Forever.

Most dividend investors never need to pay

20
stocks tracked
5x/day
price checks
$0
forever

Free tier: 10,000 API calls/month • Your 20-stock portfolio uses ~3,000/month

Free tier includes:

PriceOpenHigh/LowDividend YieldDividend Amount

Want more? Upgrade for full access (PE ratio, volume, market cap, etc.)

Try It Now (Free Tier)

=DIVV("AAPL", "price")
=DIVV("MSFT", "dividendYield")
=DIVV("JNJ", "dayHigh")

' Free tier: price, open, high/low, dividend yield

💎 Free tier includes: price, open, dayHigh, dayLow, previousClose, dividendYield, dividendAmount

Installation (5 minutes)

1

Download the VBA Module

Download our ready-to-use VBA module file

Download DIVV.bas
2

Open VBA Editor

In Excel, press Alt+F11 (Windows) or Option+F11 (Mac)

3

Import the Module

In VBA Editor: File → Import File... and select the downloaded DIVV.bas

4

Configure API Endpoint

In the VBA code, update the API_BASE_URL constant:

' For production (recommended)
Const API_BASE_URL As String = "https://api.divv.com"

' For local testing
Const API_BASE_URL As String = {API_CONFIG.baseUrl}
5

Save as Macro-Enabled

Save your workbook as .xlsm (Excel Macro-Enabled Workbook) to preserve the VBA code

6

Test the Function

In any cell, type:

=DIVV("AAPL", "price")

Press Enter. You should see the current price of Apple stock!

Available Functions

=DIVV(symbol, attribute)

Get stock data for any attribute

Examples:

=DIVV("AAPL", "price")
=DIVV("MSFT", "dividendYield")
=DIVV("JNJ", "yearHigh")
=DIVV("PG", "peRatio")

📝 Note: The Excel VBA implementation includes the same core DIVV() function as Google Sheets. Advanced functions (DIVVBULK, DIVVDIVIDENDS, DIVVARISTOCRAT) can be added to the VBA module if needed.

Compatibility

✅ Supported Versions

  • Excel 2010 and newer
  • Excel for Windows
  • Excel for Mac
  • Microsoft 365

⚠️ Limitations

  • Requires macros to be enabled
  • Not available in Excel Online (web version)
  • Mobile apps (iOS/Android) don't support VBA

Caching

The VBA module includes a worksheet-based caching system to reduce API calls and improve performance.

How it works:

  • 1. Data is cached in a hidden worksheet named _DivvCache
  • 2. Cache expires after 5 minutes by default
  • 3. Same symbol within 5 minutes = instant response (no API call)

💡 Clear Cache: To force fresh data, run this in VBA:

ClearDivvCache

Troubleshooting

#VALUE! error

Macros may be disabled. Go to File → Options → Trust Center → Trust Center Settings → Macro Settings and enable macros.

#NAME? error

The VBA module may not be imported correctly. Check the VBA Editor (Alt+F11) to ensure the DivvAPI module is present.

Function returns #ERROR

Check that the API endpoint URL is correct and the API is running. You can test connectivity by running TestDivvConnection from the VBA Editor.

Slow performance

Make sure the cache worksheet exists. The first call to each symbol will be slower (API request), but subsequent calls should be instant.