Variable declaration without an 'As' clause; type of Object assumed

A variable declaration does not specify an As clause.

An As clause identifies a data type to be associated with a programming element. In a Dim Statement, it specifies the data type of the variable or variables. If you do not include an As clause in the Dim statement, the variable's data type defaults to Object.

By default, this message is a warning. For information on hiding warnings or treating warnings as errors, see Configuring Warnings in Visual Basic.

Error ID: BC42020

To correct this error

  • Include an As clause in the Dim statement to specify the variable's data type.

See also