|
-
Jan 10th, 2005, 08:23 PM
#1
Sort problem with MSHFlexgrid [Resolved]
I get an runtime error "Method 'Sort' of IMSHFlexgid failed" using the following code. I have used this in another project and it worked there. What am I missing here?
Code:
.SelectionMode = flexSelectionByColumn
.Col = 0
.ColSel = 0
.Row = 1
.RowSel = .Rows - 1
.Sort = flexSortStringAscending
Last edited by randem; Jan 11th, 2005 at 03:17 AM.
-
Jan 10th, 2005, 08:57 PM
#2
Re: Sort problem with MSHFlexgrid
Your example works fine for me under VS SP6. Maybe you have a corrupt vbp or ???
VB Code:
Option Explicit
Private Sub Command1_Click()
With MSHFlexGrid1
.SelectionMode = flexSelectionByColumn
.Col = 0
.ColSel = 0
.Row = 1
.RowSel = .Rows - 1
.Sort = flexSortStringAscending
End With
End Sub
Private Sub Form_Load()
With MSHFlexGrid1
.AddItem "test3"
.Row = 2
.AddItem "test2"
.Row = 3
.AddItem "test1"
End With
End Sub
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 11th, 2005, 01:49 AM
#3
Re: Sort problem with MSHFlexgrid
RobDog888,
After much trial and error(s), I found the source of the problem. It was in another section of code but this problem did not occur until I added those lines of code.
I found that this line caused the problem:
.ColHeader(0) = flexColHeaderOn
for some reason you can not sort with a column header on.
-
Jan 11th, 2005, 01:51 AM
#4
Junior Member
Re: Sort problem with MSHFlexgrid
odd...I've done it before so it cant be that
-
Jan 11th, 2005, 03:08 AM
#5
Re: Sort problem with MSHFlexgrid
c00lryguy,
Well, I commented out lines of code until it worked, then uncommented the lines until it stoped working and that line was the one. It could be a combination of lines but this is the one that stoped my code from working.
-
Mar 4th, 2013, 01:47 PM
#6
New Member
Re: Sort problem with MSHFlexgrid [Resolved]
I also had this strange problem, changing old applications of VB6.
ColHeader(0) = flexColHeaderOff before sorting did the trick.
thanks randem
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|