# NEOTICKER DATA BEGIN ScriptType=Indicator Description=ReadExcelSingleCell Name=ReadExcelSingleCell Language=DelphiScript Links=1 MinBars=0 TimerInterval=100 EarlyBinding=0 MetaStyle=Normal ValueRange=Same as Source Placement=Smart Multiplot_num_plots=1 Multiplot_color_0=255 Multiplot_style_0=Line Multiplot_width_0=1 Multiplot_enabled_0=1 Multiplot_breakstyle_0=0 UpdateByTick=0 FloatMarker=1 DepthData=0 TradingSystemUI=0 PrimaryLinkOnly=1 NotifyOnRemoval=0 Param_count=4 Param_name_0=Workbook Param_inuse_0=1 Param_type_0=string Param_default_0=Book1.xlsx Param_name_1=Worksheet Param_inuse_1=1 Param_type_1=string Param_default_1=Sheet1 Param_name_2=Row Param_inuse_2=1 Param_type_2=integer.gte.1 Param_default_2=1 Param_name_3=Column Param_inuse_3=1 Param_type_3=integer.gte.1 Param_default_3=1 Explanation_Lines=0 # NEOTICKER DATA END // An example on how to access Excel data within an indicator // written by Lawrence Chan // October 24, 2009 function ReadExcelSingleCell : double; var excel_app, cell_value; begin if itself.firstcall then begin heap.allocate (1); try excel_app := getactiveoleobject ('Excel.Application'); cell_value := excel_app.workbooks (Param1.Str).worksheets (Param2.Str).cells (Param3.Int, Param4.Int).value; heap.value [0] := cell_value; except end; end; result := heap.Value [0]; end;