Page 1 of 1

Need help with Excel COM Interface precision

Posted: 24 Sep 2023, 22:05
by terenceck
Using Excel COM Interface to receive an excel cell "G20" with value of 0.932835820895522. But the result I got is 0.9328356.

The Excel COM command using to retreive is "xl.Range("G20").Text"

Re: Need help with Excel COM Interface precision

Posted: 19 Oct 2023, 09:49
by rockitdontstopit
terenceck wrote:
24 Sep 2023, 22:05
The Excel COM command using to retreive is "xl.Range("G20").Text"
Use the command "xl.Range("G20").Value" instead of text. Even if the cell contents is a formula "Value" will grab the number value.

Actually, I think you need to use the format function to display 15 decimals. String := Format(FormatStr , Values...)