OFF2000: Run-Time Error 13 Coercing Euro Symbol to Currency Data Type

ID: Q229393


The information in this article applies to:
  • Microsoft Office 2000


SYMPTOMS

The following error message may appear when your macro evaluates a statement that uses the euro symbol:

Run-time error '13':

Type mismatch


CAUSE

This error message occurs when the following conditions are true:

  • Your macro attempts to coerce a statement that uses the euro symbol to the Currency data type.

    -and-


  • The default currency symbol for your operating system is something other than the euro symbol.


For example, if your default currency symbol is the dollar sign ($), the following macro statements cause the error message described in the "Symptoms" section.

Example 1: Coercing Data Types Using Ccur Function


Ccur ("€125") 

Example 2: Coercing Variable Using Currency Data Type


Dim cEuro as Currency
cEuro = "€123.45" 


RESOLUTION

To correct this issue, set the default currency symbol for Microsoft Windows to the euro symbol:

  1. On the Start menu, point to Settings, and then click Control Panel.


  2. In Control Panel, double-click the Regional Settings icon.


  3. Click the Currency tab.


  4. Click the Currency symbol box, and type ALT+0128 on the numeric keypad.


  5. Click OK to change the default currency symbol to the euro.



MORE INFORMATION

The Ccur function in Microsoft Visual Basic for Applications coerces, or forces, an expression into the Currency data type. Additionally, when you dimension a variable to a specific data type, you also coerce an expression to that particular data type. For example, to coerce the expression "$456.78" to the Currency data type you could use either of the following statements:


Ccur ("$456.78") 
-or-

Dim sVal as Currency
sVal = "$456.78" 
However, when you try to coerce an expression that contains the euro currency symbol, a run-time error occurs if the default currency symbol for Microsoft Windows is not set to the euro symbol.


REFERENCES

For more information about how to coerce currency data types, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type Type Conversion Functions in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

Additional query words: OFF2000 XL2000 Y2K

Keywords : kbdta kb2000 OffVBA KbVBA
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbprb


Last Reviewed: September 20, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.