Thank you everyone, it solved i'm using new module to execute the function, when I open the document. Eventhough I hadn't try it with another computer. Yes, I change the variable to double, I think there is no different with currency.

On 08/12/2011 03:02 AM, planas wrote:
On Thu, 2011-08-11 at 11:17 +0200, Andreas Säger wrote:

Am 10.08.2011 09:23, toto wrote:
I'm using macro's function and it doesn't start when the document start.
It would start if I change the value of the variabel at the function.
The code is to change numeric value to string. If I execute the code:
ubah(123) the result is "seratus dua puluh tiga". Any idea how to make
the function executed when I open the document?

The code is:

Public Function ubah(x as currency) as String
Currency is not a valid type to be used in a spreadsheet.
  From the Basic perspective all spreadsheet values are doubles or
string, errors are Null, empty cells are empty strings. There are no
"date values" in particular.
Subtle little gotcha, use dates/time and currencies in the spreadsheet but the 
value must be converted to a valid Basic data type.

This function works as expected:
Function DOUBLE(n as Double)
   DOUBLE = n *2
End Function

This function returns a text value.
Function DOUBLE_CURR(n as Currency)
   DOUBLE_CURR = n *2
End Function

I can not reproduce the recalculation problem, though.
Both versions of the above functions recalculate when I load the
document or when I modify A1 with auto-cacluation enabled.
A1 =PI()
=DOUBLE(A1) =>  6.2832 (number)
=DOUBLE_CURR(A1) =>  6.2832 (text)






--
For unsubscribe instructions e-mail to: [email protected]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Reply via email to