0

I want to write a Bloomberg formula in an excel cell with VBA. The formula, if written in the Cell directly "by hand", works as intended. I tried the following Code:

isin = Cells(ActiveCell.Row, 6).Value
Cells(ActiveCell.Row, 37).Value.Formula = "=BDP(""" & isin & " ISIN"";""SHORT_NAME"")"

but I get an error 424 (object required).

If I try using only .Value or .Formula (I found a lot examples like this online) like:

Cells(ActiveCell.Row, 37).Value = "=BDP(""" & isin & " ISIN"";""SHORT_NAME"")"

or

Cells(ActiveCell.Row, 37).Formula = "=BDP(""" & isin & " ISIN"";""SHORT_NAME"")"

I get an error 1004 (Application-defined or Object-defined error)

Flx
  • 1
  • 1
  • Does `.FormulaLocal` instead of `.Formula` work? – BigBen Apr 28 '21 at 12:49
  • Yea it works if using only FormulaLocal! Cells(ActiveCell.Row, 37).FormulaLocal = "=BDP(""" & isin & " ISIN"";""SHORT_NAME"")" Thank you – Flx Apr 28 '21 at 13:03

0 Answers0