atul Site Admin
Joined: 18 Jul 2005 Posts: 8
|
Posted: Tue Jun 24, 2008 8:04 am Post subject: FIX: You get a 'Type Mismatch' error in VB or VBA |
|
|
This error occurs because there is a naming conflict between FileView's objects and objects from other libraries that your project has referenced. For example, if your project references the 'Microsoft Windows Common Controls' library, there will be a naming conflict between the ListItem object defined in that library and the ListItem object defined in FileView. Thus, the following code will cause the 'Type Mismatch' error :
Dim item as ListItem
Set item = fileView1.FirstSelectedItem ' this line causes the 'Type Mismatch' error
This error can be fixed by explicitly specifying the scope of the object as follows :
' Use 'FileViewControl.ListItem' instead of only 'ListItem'
Dim item as FileViewControl.ListItem
Set item = fileView1.FirstSelectedItem |
|