Reputation: 80
Whenever i run my project, it highlights the "Private Sub HighlightGridRow(grd As MSFlexGrid, iRow As Long)" row and pops up a box with the error message "User-defined type not defined". What can i do to make it work?
Private Sub HighlightGridRow(grd As MSFlexGrid, iRow As Long)
With grd
If .Rows > 1 Then
.Row = iRow
.Col = 1
.ColSel = .Cols - 1
.RowSel = iRow
End If
End With
End Sub
Upvotes: 1
Views: 2483
Reputation: 46
As Peter Cooper Jr said, you probably don't have MSFlexGrid referenced in your project. To do that, go to Project -> Components, then check the box next to "Microsoft FlexGrid Control 6.0" if it's on the list. If not, you will have to click browse and manually add it.
If you can't find the ocx, just download it:
https://www.opendll.com/index.php?file-download=msflxgrd.ocx&arch=32Bit&version=6.0.84.18
Upvotes: 0
Reputation:
VB6 is not knowing what the type MSFlexGrid
is, so it's assuming that it's a user-defined type that you haven't defined. More likely, you're trying to use a component that isn't referenced. You need to go to Components in the Project menu and add the Flex Grid component that you're trying to use.
This isn't quite an exact duplicate of this question since it's a different component missing, but you may be able to find more useful information there as well.
Upvotes: 3
Reputation: 13267
Seems likely that MSFlexGrid
is not a defined type, probably because you didn't add the OCX to the ToolBox. Maybe the program uses MSHFlexGrid
instead and you have copy/pasted code that doesn't fit?
Shouldn't have anything to do with the OCX not being registered. That would more likely fail on an object creation exception instead.
Upvotes: 1