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



The information in this article applies to:

  • Microsoft Excel 2000
  • Microsoft Access 2000
  • Microsoft FrontPage 2000
  • Microsoft Outlook 2000
  • Microsoft PowerPoint 2000
  • Microsoft Publisher 2000
  • Microsoft Word 2000

This article was previously published under Q229393

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.

Modification Type:MinorLast Reviewed:10/11/2006
Keywords:kberrmsg kbpending kbprb KB229393