Here's a code snippet of a routine that saves all properties of an object to cells in a row
where r is a range (a single cell), obj is an object, prop is a String containing the name of a property of obj.
For those not familiar with the function, the callbyname function just calls the getter for a property named by a string.. same as var=obj.prop (ie var=objPerson.Name)
In this case the property returns data type Single.
The var variable shows as Variant/Single in the locals window.
stepping through the debugger, after the last line of code executes, the immediate window shows the following:
?var
0.565
?r.Value
0.564999997615814
I would like the cell to accurately reflect the value of the property whether the property is text, single, integer, etc.
Anyone know why the change in precision on the assignment?
Bookmarks