Hello again all,
Im building a horse racecard analysis tool in excel 2007, using userform. I have a treeview that get todays race courses events and adds them to the parent nodes, and then from the same data file it gets todays races times and uses them as the child nodes for each parent node in the treeview.
After a lot of jiggery pockery I have this working reasonably well. However, for some weird reason on 5 of the child nodes I am getting no records found, when they are clearly there in my imported csv file.
Total parent nodes = 8, and there are 6-7 child nodes in each. The problem child nodes are; 2 under one parent, and 1 under each of 3 different parent node... But strangly enough the other child nodes work fine, getting data to set as label text values on child node click event. The problem child nodes return the error above "Unable to get the Match property of the WorksheetFunction class". I dont understand why when it can do it for the other ones.
I have tried Application.Worksheet.Match / Worksheet.Match / Application.Match, but all return the same error for these specific child nodes. Checking the csv file the race time column (B) is set to custom value hh:mm. As I am retrieving the data from a python web scraper that I haven't written (GitHub) I would prefer to leave the data file as is. Plus its working fine for most of the child nodes so assume the issue is somewhere else.
I can handle the error within the code but thats not a solution as I need the row of data that is clearly there in the csv file, for this child node click event, but also later when populating a Listview, so trying to figure this out now before proceeding any further.
Debugging didn't give me much either, stepping through the code I can see the working child nodes get the race course and race time, and get, usually, the first row for a matched race start time, and the code completes as expected. The problem childs however, get the race course and race time, but don't get or match any row numbers, and so the thing breaks. I cant figure why they are not working when it running the same code!
Also there appears to be no pattern to the child nodes not finding a match. I even created a new web scrape data file and tried that, incase I had messed about with the original, but if anything that has even more child nodes not finding a match, even though the data is there to see. And the sequence of none working child nodes in the treeview using old csv file and updated version (different data) seem to be completely random. Random between the 2 data files but consistent when working on the same file.
Im lost. Hoping someone has experienceed this before and knows a solution.
TIA
I've posted my code to pastebin if anyone want to have a look without downloading the project files https://pastebin.com/LRWFXVfK
Bookmarks