Dynamic spreadsheet Value in C++

I am working with a spreadsheet that is updating stock data in real time…which is row 2 column 44(I am aware of the indexing nature to 0)Which is the current value in real time updating every millisecond. Every 240 minutes the value. Let’s call the Value number of traders Dumps to the cell 3 and becomes static. I have the over all code to updating correctly as AutoLoop = 1; which is a code logic that allows the over all script as a whole to recalculate every bar…in this case every 240 minutes and then if any condition within the script becomes true will happen at any given time with that bar. So that is all as needs to be. How ever I am trying to get the exact value of column 44 row 2 at any given moment…let’s just say I have coded a condition for a moving average to cross…Which is all functioning properly and as should be. But say the moving average crosses at 17:40:20(the timing of this will be irrelevant as it’s coded already correctly in the script. I need to be able to both get the exact value and dump it into the spreadsheet so I can view it for every time the moving average crosses

right now I am using this function


int GetSheetCellAsDouble(void* SheetHandle, const int Column, const int Row, double& r_CellValue);

The sc.GetSheetCellAsDouble() function places the value of the requested Spreadsheet Sheet Cell in the double variable r_CellValue.

If the cell does not contain a value, then this function returns a value of 0. Otherwise, it returns a value of 1.


  • SheetHandle: The handle of the Spreadsheet Sheet as returned by the sc.GetSpreadsheetSheetHandleByName() function.
  • Column: The column number for the Sheet Cell to get the value from. This is a zero-based array, so column B in the Sheet would be a value of 1.
  • Row: The row number for the Sheet Cell to get the value from. This is a zero-based array, so row 2 in the Sheet would be a value of 1.
  • r_CellValue: A reference to a double variable that receives the value of the Sheet Cell.

The sheet handle and all that works correctly.

double currentValue = 0.0;
sc.GetSheetCellAsDouble(SheetHandle, 43, 2, currentValue);

But I can not get it to work. Do I need to build an array at the index? I know how to do this at say a graphing structure if Y value is dynamic at index 0. But I am unsure how this works with a spreadsheet. Is the current real time of data dumped to a spreadsheet an index also and if so do I need to build an array of index from my current value first …If so how to I get it to be the index of 43,2 ??