Sky Software Homepage LogicNP Software Knowledge Base And FAQ

 
Contact Product Support    SearchSearch      Subscribe to the RSS feed for this forum

FIX: You get a 'Type Mismatch' error in VB or VBA

 
Subscribe to the RSS feed for this forum  Forum Index -> FileView ActiveX Control
View previous topic :: View next topic  
Author Message
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
Back to top
Display posts from previous:   
Forum Index -> FileView ActiveX Control All times are GMT
Page 1 of 1

 
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group