The Frog
unread,May 13, 2013, 5:29:45 AM5/13/13You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hi Phil,
Think I figured out what the problem is. When using automation to control things or work with things you have to keep in mind the the object you are automating isnt always 'perfectly' written. In this case I have been re-cycling a single object for many tens of thousands of loop cycles and it just doesnt seem to be able to recover from that each and every time. I cant tell if there is a memory leak taking place at the same time.
The control that is causing the poblem is 'Microsoft HTML Object Library'. I am using it to parse some large amounts of HTML files. Eventually it crashes. Restart the application and it continues on with no errors at all. The reason I think the error trap is not working is that contol is never returned to Access to trap it! I cant prove that, but it is the only thing that seems to make any sense. When control is eventually returned to Access the error isnt being reported to access as an event it has to deal with so the error is never 'fired', Access remains ignorant of it, then the app just continues until it crashes because a dependant component is buggered.
What I am going to have to do is incorporate a second error check into the routine so that after the html document object is 'SET' to its new contents the application specifically checks for an error code instead of relying on the ON ERROR statement to work (which it certainly isnt). Manually disposing of the object and recreating it allows the application to continue unfettered. All I can guess is that it is one of those quirks that you just have to find out about the hard way as it sure as hell isnt in the documentation!
Do you need some help at all working with the HTML library? Its actually quite useful if you have to parse HTML files, makes your logic quite easy to follow for debugging and does a vastly superior job to using pure XML parsing or Regex. Right tool for the job, just a little unstable it seems. Manageable though. Can post some code if you like, just not sure its useful to anyone.
Cheers
The Frog