private void ProcessFormulaValue() { if (this.val[6] == 0xFF && this.val[7] == 0xFF) { // this value is a string, an error or a boolean value byte firstOffset = this.val[0]; if (firstOffset == 1) { // this is a boolean value this.boolValue = this.val[2]; this.boolValueSet = true; } if (firstOffset == 2) { // this is a error value this.errorValue = (int)this.val[2]; } } else { using (BinaryReader b = new VirtualStreamReader(new MemoryStream(this.val))) { this.calculatedValue = b.ReadDouble(); } } }