VBA Functions Reference: Yahoo Finance

Excel Price Feed includes several functions which are specially designed to be used from VBA. They are all non-asynchronous functions which means that code execution is halted whilst awaiting the result of the function (unlike the regular Excel formulas which cannot be used with VBA).

Formula Description
EPF.Yahoo.VBA.Price Current mid price.
EPF.Yahoo.VBA.DayChange Change in price today.
EPF.Yahoo.VBA.DayChangePercent Percentage change in price today.
EPF.Yahoo.VBA.DayLow Day low.
EPF.Yahoo.VBA.DayHigh Day high.
EPF.Yahoo.VBA.DayVolume Volume of shares traded today.
EPF.Yahoo.VBA.PrevClose Previous market close price.
EPF.Yahoo.VBA.MarketOpen Market open price.
EPF.Yahoo.VBA.MarketCap Current market capitalisation.
EPF.Yahoo.VBA.52WeekLow 52 week low.
EPF.Yahoo.VBA.52WeekHigh 52 week high.
EPF.Yahoo.VBA.PERatio PE Ratio TTM (Trailing Twelve Months).
EPF.Yahoo.VBA.EPS EPS TTM (Trailing Twelve Months).
EPF.Yahoo.VBA.TrailingAnnualDividendRate Trailing annual dividend rate.
EPF.Yahoo.VBA.TrailingAnnualDividendYield Trailing annual dividend yield.
EPF.Yahoo.VBA.Currency The 3 letter ISO currency code of the
instrument eg USD, EUR, JPY etc.
EPF.Yahoo.VBA.Name Company name.
EPF.Yahoo.VBA.QuoteType Quote type, for example
"EQUITY" or "MUTUALFUND".

Examples

1. Return the live bid price of Apple stock:

Dim stockPrice As Variant
stockPrice = Application.Run("EPF.Yahoo.VBA.Price", "AAPL")


Yahoo Finance Excel VBA live price function



Options Chain VBA Functions

Excel Price Feed includes 3 Excel VBA Functions for retrieving Options Chain data:


EPF.Yahoo.VBA.OptionsChain.List

This function returns options chain list data for the specified ticker and optional expiry date:

EPF.Yahoo.VBA.OptionsChain.List(ticker, expiryDate [OPTIONAL])

The input parameters required are:

Parameter Description
Ticker The ticker for the instrument, eg "APPL" or "SPY".
Expiry Date If no expiry date is specified options for the next expiry date are downloaded.

EPF.Yahoo.VBA.OptionsChain.Straddle

This function returns options chain straddle data for the specified ticker and optional expiry date:

EPF.Yahoo.VBA.OptionsChain.Straddle(ticker, expiryDate [OPTIONAL])

The input parameters required are:

Parameter Description
Ticker The ticker for the instrument, eg "APPL" or "SPY".
Expiry Date If no expiry date is specified options for the next expiry date are downloaded.

EPF.Yahoo.VBA.OptionsChain.ExpiryDates

This function returns a list of all possible option expiry dates for the specified ticker:

EPF.Yahoo.VBA.OptionsChain.ExpiryDates(ticker)

The input parameter required is:

Parameter Description
Ticker The ticker for the instrument, eg "APPL" or "SPY".