Accessing cell dependencies

6.30K viewsScripting
0

Some while ago this question arose for QAPI: [url:dxe15gzr]http://www.quantrix.com/forums/showthread.php?t=492[/url:dxe15gzr]

[INDENT][quote="J Scott":dxe15gzr]I am working on a plugin that will perform “breakback” of a value across its preceding cells. For example, if a cell calculates the sum of 10 numbers, I will provide a way for the user to enter a new sum and have the sum be proportionally spread across the 10 preceding numbers that feed the sum.

What I’m stuck on is how to get the precedent cells from a given cell range. You can do this manually using Dependency Inspector, but how do you do it in QAPI?[/quote:dxe15gzr]

[quote="Blue":dxe15gzr]Sorry, QAPI does not provide a way to do this. It can be done with the Extended API which requires an additional license. It has a class ExtendedMatrixView with a method getFormulaRanges() that returns the ranges referred to by a specified formula in the matrix.[/quote:dxe15gzr][/INDENT]

Does the 4.0 scripting engine provide access to the dependency information for a cell (with or without an additional license)? There is no available method on a cell, but maybe via some other route??

Thanks

Simon

0

Simon
@Quantrix Developers

Looking into the QAPI Docs reveals that there are two boolean functions which fits to Simon’s request for testing whether a cell is an input cell or calculated by a formula. I suggest to add these two functions to the scripting engine because it is important to prevent a script to overwrite a cell which is caluclated by a formula. Or are they available already? Please let me know, thanks.

These are the mentioned functions (Interface: QCell):
[list:38e7v5ao]
[*:38e7v5ao] canSetValue() -> returns true if the cell is an input cell and is not locked[/*:m:38e7v5ao]
[*:38e7v5ao] getIsCalculatedValue() -> returns true if the cell is being calculated by a formula[/*:m:38e7v5ao][/list:u:38e7v5ao]

Dominik

You are viewing 1 out of 7 answers, click here to view all answers.