我想为Calc编写一个基本函数,该函数返回#VALUE!可以用ISERR()进行测试。
Function foo()
foo = #VALUE!
End Function
但是那个foo函数返回0而不是一些错误 #VALUE!。我该怎么做?
我想为Calc编写一个基本函数,该函数返回#VALUE!可以用ISERR()进行测试。
Function foo()
foo = #VALUE!
End Function
但是那个foo函数返回0而不是一些错误 #VALUE!。我该怎么做?
看起来只有在电子表格中发生计算错误时才会显示#VALUE!
,因此不可能返回该错误。
相反,当需要数字时,通过返回文本来引起#VALUE!
错误:
Function get_number() As Any
'get_number = 0 'This line will not cause an error.
get_number = "" 'This line will cause #VALUE! because it is not a number.
End Function
将公式设置为=ISERR(GET_NUMBER() + 0)
。
参见https://forum.openoffice.org/en/forum/viewtopic.php?t=44830。