OLE::Variant array of strings

Discussion in 'Perl Misc' started by kevind0718@gmail.com, Aug 16, 2007.

  1. Guest

    Hello:
    I am attempting to access Bloomberg, an ActiveX control (a fincial
    data source) via Perl. I can not figure out how to pass a variant
    array of strings to the above ActiveX control.

    Here is my PERL code.
    use Win32::OLE;
    use Win32::OLE::Variant;
    $blpData = Win32::OLE->new('Bloomberg.Data.1') or
    die "can NOT load the blpData" ; #print $blpData->Timeout . "\n";
    $aSec = Variant(VT_BSTR, "IBM Equity");
    @tmpArray = ("PX_Last");
    $aFields = Variant(VT_ARRAY|VT_UI1, "PX_Last" );
    $sDate = Variant(VT_DATE, "2007/07/01");
    $eDate = Variant(VT_DATE, "2007/07/10");
    @bbData = Variant(VT_EMPTY, undef);
    @bbData = $blpData->BLPGetHistoricalData($aSec, $aFields, $sDate,
    $eDate);
    print "Array Size: " , $#bbData . "\n";
    foreach $bbData (@bbData) {
    print $bbData
    }
    print "end" ;

    Here the documentation on the BLPGetHistoricalData call
    VARIANT BLPGetHistoricalData (VARIANT Security, VARIANT Fields,
    VARIANT StartDate, VARIANT EndDate,
    VARIANT BarSize, VARIANT BarFields);
    Security: in Specifies either a single security, or array of
    securities as the basis of the request. See Security Syntax
    Fields: in An array of Bloomberg field references, or mnemonics. All
    applicable fields can be found in the bbfields.tbl data dictionary.
    For a list of the three fields which can be used for an Intraday Time-
    Bars request, see the Time-Bar Fields page.
    StartDate: in Either an absolute date indicating the first date about
    which data will be returned, or a numerical value relating to the
    number of days back in history to report from. The latter type
    indicates an intraday activity request. For more details, click the
    StartDate link in the above method signature.
    EndDate: in, optional Indicates the final date about which data will
    be reported. Omitting this parameter causes all data to be reported up
    until the current time of request.

    Please note that the Fields parameter expects a variant.

    Question: How do I create a variant array of strings?
    I am getting an error on the Fields parameter.
    Need help to make some VBA macros go away.


    Thanks in Advance

    KD
     
    , Aug 16, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    1,092
    Thomas 'PointedEars' Lahn
    Mar 20, 2006
  2. Patrick.O.Ige

    Ole ole

    Patrick.O.Ige, Jul 16, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    498
    Patrick.O.Ige
    Jul 16, 2006
  3. Drew Pihera
    Replies:
    0
    Views:
    647
    Drew Pihera
    Feb 4, 2004
  4. Brian Helterline

    OLE Variant

    Brian Helterline, Jul 1, 2003, in forum: Perl Misc
    Replies:
    2
    Views:
    89
    Ken Brown
    Jul 2, 2003
  5. Lance Hoffmeyer
    Replies:
    0
    Views:
    245
    Lance Hoffmeyer
    Nov 17, 2003
Loading...

Share This Page