If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Free send mail?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-31-10, 06:37
mikezx10 mikezx10 is offline
Registered User
 
Join Date: Oct 2003
Posts: 226
Free send mail?

I need to create a scheduled task that will open an excel file
Qry Bloomberg and then email the results. The computer is in my office but not part of the network. Is there a way to send emails with out outlook ?

If you can think of a better process I would also be interested. The bloomberg qry is for Fx Rates. Oh if you know of another way to get fx rates that would be even better

Thanks
Reply With Quote
  #2 (permalink)  
Old 03-31-10, 07:31
kitaman kitaman is offline
Papabi's friend
 
Join Date: Sep 2009
Location: Ontario
Posts: 627
Install Microsoft Services for Unix, a free download from MS,
Download details: Windows Services for UNIX Version 3.5

Then use
mail -s "Subject" to@domain.com <text_file
where text_file is the output of your program.
Reply With Quote
  #3 (permalink)  
Old 03-31-10, 08:14
mikezx10 mikezx10 is offline
Registered User
 
Join Date: Oct 2003
Posts: 226
Microsoft Services for Unix for a computer running MS XP?
Reply With Quote
  #4 (permalink)  
Old 03-31-10, 10:08
Colin Legg Colin Legg is offline
Registered User
 
Join Date: Sep 2008
Location: London, UK
Posts: 495
I can help with the Bloomberg ---> Excel part... which FX rates do you need, and do you want to pull them in using formulas or VBA?
__________________
Colin

RAD Excel Blog

Other tutorials:
Array Formulas | Deleting Rows with VBA
Reply With Quote
  #5 (permalink)  
Old 03-31-10, 11:10
mikezx10 mikezx10 is offline
Registered User
 
Join Date: Oct 2003
Posts: 226
CHF (CHF)
AUD (USDAUD)
GBP (USDGBP)

i would like to pull formulas & vba if possible (just in case)
Reply With Quote
  #6 (permalink)  
Old 03-31-10, 11:16
Colin Legg Colin Legg is offline
Registered User
 
Join Date: Sep 2008
Location: London, UK
Posts: 495
For my peace of mind, please can you also confirm that distributing proprietry Bloomberg data like this doesn't breach any Bloomberg licencing agreements?

Is that first rate USD/CHF?
__________________
Colin

RAD Excel Blog

Other tutorials:
Array Formulas | Deleting Rows with VBA
Reply With Quote
  #7 (permalink)  
Old 03-31-10, 11:18
mikezx10 mikezx10 is offline
Registered User
 
Join Date: Oct 2003
Posts: 226
LOL the data is used in house for fx Gain loss accounting calc, yes the 1st is USD /CHF
Reply With Quote
  #8 (permalink)  
Old 03-31-10, 12:16
Colin Legg Colin Legg is offline
Registered User
 
Join Date: Sep 2008
Location: London, UK
Posts: 495
Which date(s)/time(s) do you want the rates from? COB yesterday?
__________________
Colin

RAD Excel Blog

Other tutorials:
Array Formulas | Deleting Rows with VBA
Reply With Quote
  #9 (permalink)  
Old 03-31-10, 12:19
mikezx10 mikezx10 is offline
Registered User
 
Join Date: Oct 2003
Posts: 226
I would be running it every morning as of COB prior day. Are you in ny i think i owe u a beer for this effort LOL
Reply With Quote
  #10 (permalink)  
Old 03-31-10, 13:29
Colin Legg Colin Legg is offline
Registered User
 
Join Date: Sep 2008
Location: London, UK
Posts: 495
I'm in London, England, but I'd be happy to visit and buy you a beer if you cover my flights!

I've got Bloomberg at work so I'll post a solution tomorrow when I'm back in the office. I think there may be complications with the formula-based solution if you are automating the process.
__________________
Colin

RAD Excel Blog

Other tutorials:
Array Formulas | Deleting Rows with VBA
Reply With Quote
  #11 (permalink)  
Old 03-31-10, 21:08
kitaman kitaman is offline
Papabi's friend
 
Join Date: Sep 2009
Location: Ontario
Posts: 627
Quote:
Originally Posted by mikezx10 View Post
Microsoft Services for Unix for a computer running MS XP?
Yes, it installs like any other application, and gives you a KSH shell,and a CSH shell, along with the basic Unix utilities (sendmail, vi, grep) etc.
Reply With Quote
  #12 (permalink)  
Old 04-06-10, 10:57
Colin Legg Colin Legg is offline
Registered User
 
Join Date: Sep 2008
Location: London, UK
Posts: 495
Bloomberg -

First a formula approach.

In A1 put a date, say yesterday's date:
Code:
=TODAY()-1
In C3 put the currency ticker:
Code:
USDCHF Curncy
In C4 type in this field header (purely aesthetic):
Code:
Date
In D4 we need the field name to look up:
Code:
PX_LAST
Then in C5 the formula to retrieve the data:
Code:
=BDH($C$3,$D$4,$A$1,$A$1,"Dts=S","Quote=C","Days=A","DtFmt=D","cols=2;rows=1")
  • BDH is the Bloomberg Data History function.
  • PX_LAST is the last price on the date specified.
  • The DTS parameter defines whether or not to display the price's corresponding date ("S" is show). DtFmt formats the date output.
  • The Quote parameter defines whether to retrieve Average or Close price ("C" is close).
  • The Days parameter defines which days to observe. "A" is all calendar days.

If A1 contains a non-business day then it will retrieve the closing price from the previous business day. eg. For 4th April 2010 the price returned would be the closing price on 2nd April 2010.

Just repeat the set-up for each currency pair. The other tickers you need are:
Code:
AUDUSD Curncy
GBPUSD Curncy
I got all of this information using the import wizard in Excel under Bloomberg | Import Data. The Bloomberg Excel Tools add-in must be installed for the BDH() function to be recognised.

VBA solution to follow...
__________________
Colin

RAD Excel Blog

Other tutorials:
Array Formulas | Deleting Rows with VBA
Reply With Quote
  #13 (permalink)  
Old 04-06-10, 13:40
Colin Legg Colin Legg is offline
Registered User
 
Join Date: Sep 2008
Location: London, UK
Posts: 495
It looks like there are a few different (but seemingly similar) methods available in the Bloomberg API to retrieve the data. There are bound to be caveats that I'm not aware of, but this works for me:
Code:
    'reference to the bloomberg data type library required 
 
Sub foo()
 
    Const strFIELD As String = "PX_LAST"
 
    Dim objBBG As BLP_DATA_CTRLLib.BlpData
    Dim vResults, vCurrencies
 
 
    vCurrencies = Array("USDCHF Curncy", "AUDUSD Curncy", "GBPUSD Curncy")
    Set objBBG = New BLP_DATA_CTRLLib.BlpData
    objBBG.AutoRelease = False
 
    vResults = objBBG.BLPGetHistoricalData(security:=vCurrencies, _
                                        fields:=strFIELD, _
                                        StartDate:=VBA.Date - 1, _
                                        EndDate:=VBA.Date - 1)
 
    'what did we find?
    Stop 'have a look at vResults in the locals window
 
 
    Set objBBG = Nothing
 
End Sub
For reasons *unknown*, one of the other calls might be better.
__________________
Colin

RAD Excel Blog

Other tutorials:
Array Formulas | Deleting Rows with VBA
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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