XL2000: Error Message: "Error 2015" or "Run-time Error '13': Type Mismatch " (211601)
The information in this article applies to:
This article was previously published under Q211601 SYMPTOMS
In Microsoft Excel 2000, if you use the Evaluate method in a Visual Basic for Applications macro to evaluate a statement or formula that contains a date, the method may return either of the following error
messages:
Run-time error '13':
Type mismatch
Error 2015
CAUSE
This problem may occur when the following conditions are true:
- The date you are passing to the Evaluate method contains a two-digit year instead of a four-digit year. For example, the date contains the year 25 rather than 2025.
-and-
- The date you are passing to the Evaluate method uses either the day/month/year order or the year/month/day order.
-and-
- The date is stored as a text string, for example, "25/7/5".
Specifically, the problem occurs because Microsoft Excel tries to evaluate
the date using the month/day/year date order, even if the date was not
entered using that date order. If the date includes a four-digit year,
Microsoft Excel is able to determine the correct date; if not, the date may
not be able to be resolved. If this is the case, Microsoft Excel returns an
error value.
See the "More Information" section later in this article for a
demonstration of this problem.
WORKAROUND
To prevent this problem from occurring, use any of the following methods:
- Use four-digit years whenever possible in your dates. For example, instead of typing 25/1/1 (January 1, 2025), type 2025/1/1.
-or-
- Make sure that all of the dates are entered using the month/day/year
date order.
-or-
- Use the DATE function to convert text dates into serial dates, for example:
Application.Evaluate("DATE(25,7,5)+1")
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Minor | Last Reviewed: | 10/11/2006 |
---|
Keywords: | kbbug kbdtacode kberrmsg kbpending KB211601 |
---|
|