Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Bloomberg DDE problem

I'm getting the Bloomberg name and last_price via a DDE link using the
BLP and BLPSH formula. The code is below.

My problem is that for no apparent reason I get #REF! scattered around
in the cells. I can enter the same formula the #REF! cell contains in
a new Excel sheet and come up with the correct data. Does anybody have
a hint as to why this is happening?

I'm pulling my hair out over this one.

' Set Bloomberg Formulas
ActiveSheet.Range("AF7").Select
Do Until IsEmpty(ActiveCell.Offset(0, -5).Value) 'Look at Index
column
If Not IsEmpty(ActiveCell.Offset(0, -1).Value) Then ' If
Security name is not empty
'Set Bloomberg Name
strBloombergFormula = "=BLP(""" & ActiveCell.Offset(0,
1).Value & """,""NAME"")"
ActiveCell.Formula = strBloombergFormula
'Set Bloomberg Price
If Not IsEmpty(ActiveCell.Offset(0, 2).Value) Then
strBloombergFormula = "=BLPSH(""" &
ActiveCell.Offset(0, 1).Value & """,""LAST PRICE"",""" &
ActiveCell.Offset(0, 2).Value & """)"
ActiveCell.Offset(0, 3).Formula = strBloombergFormula
End If
'Set Check_1 Price
If Not IsEmpty(ActiveCell.Offset(0, 4).Value) Then
strBloombergFormula = "=BLPSH(""" &
ActiveCell.Offset(0, 1).Value & """,""LAST PRICE"",""" &
ActiveCell.Offset(0, 4).Value & """)"
ActiveCell.Offset(0, 5).Formula = strBloombergFormula
End If
'Set Check_2 Price
If Not IsEmpty(ActiveCell.Offset(0, 6).Value) Then
strBloombergFormula = "=BLPSH(""" &
ActiveCell.Offset(0, 1).Value & """,""LAST PRICE"",""" &
ActiveCell.Offset(0, 6).Value & """)"
ActiveCell.Offset(0, 7).Formula = strBloombergFormula
End If
'Set Check_3 Price
If Not IsEmpty(ActiveCell.Offset(0, 8).Value) Then
strBloombergFormula = "=BLPSH(""" &
ActiveCell.Offset(0, 1).Value & """,""LAST PRICE"",""" &
ActiveCell.Offset(0, 8).Value & """)"
ActiveCell.Offset(0, 9).Formula = strBloombergFormula
End If
'Set Check_4 Price
If Not IsEmpty(ActiveCell.Offset(0, 10).Value) Then
strBloombergFormula = "=BLPSH(""" &
ActiveCell.Offset(0, 1).Value & """,""LAST PRICE"",""" &
ActiveCell.Offset(0, 10).Value & """)"
ActiveCell.Offset(0, 11).Formula = strBloombergFormula
End If
'Set comment in Ending Equity column
'' ActiveCell.Offset(0, -7).Value = "BLOOM"

End If

ActiveCell.Offset(1, 0).Select
Loop

'Active the Bloomberg DDE Link.
Application.Run "BLPCreate"
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bloomberg and Indirect Mark Costello[_2_] Excel Discussion (Misc queries) 0 July 16th 08 09:56 AM
Bloomberg on toolbar Peter O'S Excel Discussion (Misc queries) 1 January 12th 06 07:00 PM
Downloading from Bloomberg! Rohit Excel Discussion (Misc queries) 1 June 28th 05 04:04 AM
Bloomberg DDE links DMG Excel Discussion (Misc queries) 0 March 30th 05 03:59 PM
DDE links to Bloomberg DMG Excel Discussion (Misc queries) 2 March 10th 05 08:38 PM


All times are GMT +1. The time now is 05:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"