WD97: WordBasic.ToolsCalculate Returns Incorrect ResultLast reviewed: February 11, 1998Article ID: Q165097 |
The information in this article applies to:
SYMPTOMSWhen you use the WordBasic.ToolsCalculate command in a Visual Basic for Applications macro, the result returned may be incorrect.
CAUSEThe following WordBasic.ToolsCalculate command will return a value of 342999999999.999 to the variable, Result$.
Result$ = WordBasic.ToolsCalculate("7000 ^ 3")The correct result is 343000000000.
WORKAROUNDWhen you use Visual Basic for Applications, you do not need to use the ToolsCalculate command to perform exponential calculations. The following function performs the same calculation but returns the correct result of 343000000000 to the integer variable, iResult.
Sub Result() Dim iResult As Double iResult = 7000 ^ 3 End Sub STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
|
Additional query words: vb vbe vba
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |