Type | Description | |||
Amount as Variant | A numeric expression that indicates the amount being converted. If the argument is missing, 1.00 is used | |||
CurFrom as Variant | A string expression that indicates the base currency, like "USD", "EUR", and so on. The currency name must contain exactly 3 letters. If the parameter is missing, the "USD" is used. | |||
CurTo as Variant | A string expression that indicates the target currency, like "USD", "EUR ", and so on. The currency name must contain exactly 3 letters. If the argument is missing the "EUR" is used. | |||
Double | A numeric expression that indicates the converted value. -1 is returned if the conversion fails. The conversion fails if there are internet, firewall or network problems. |
The Currencies property gets the list of available international currencies. For instance by calling the Convert property with no arguments, it returns the exchange rate between USD and EUR. By default, the currently exchange rate is getting from Internet each time when Convert property is called. You can use maps or hash tables in order to optimize how many times the Convert property gets the exchange rate from Internet.
If you want to get the exchange rate between two international currencies in the past, the Date property should be called prior to Convert property as in the following sample:
Dim n As New EXCHANGELibCtl.ExChange
n.Date = "1/1/2001"
MsgBox n.Convert(1, "USD", "XAU")
In the sample, if the Date property is not called the current exchange rate
is getting from Internet.