|
Actually, a type mismatch can occur for one of two reasons. Firstly, you're trying to do something impossible that VB can't do, such as set an Object equal to a Long. Secondly, you're trying to do something such as set a string equal to a number, which under strict typecasting (option explicit on) will raise an error. By turning it off, and seeing if the error occurs again, you can decide which of the two circumstances it is and eliminate down to specific areas of the code, which is useful with large projects.
Obviously, you'll correct the error and turn Option Explicit back on for the final compile.
|