problems with xml load on form

tanzania

Registered User.
Local time
Today, 13:03
Joined
Oct 20, 2006
Messages
91
Hi, I have some code that opens an xml document using xmlDOM. I then update a table from parsing the xml code. The problem is that I get an automation error which says that the 'data necassary to complete this operation is not yet available' when i run the code. But if I aad in a msgbox or custom (dialog) form that has to be manually closed straight after the doc load then it all works fine! Does anyone have any ideas why this is and what I can do to fix it?

tan
 
Process is not completing before code is taken somewhere else, perhaps a Close or table access of some sort. Allow the import code to finish. Try implanting a DoEvents into the Code.

.
 
i tried doevents and this did not help. Can you please explain further what you meant by using Close or tables?
 
three ideas

1. after the load, dont automate the next process - require a button to be pressed - that will probably slow it down enough

2. put the hourglass on, wait a period of time eg 2 secs, then turn hourglass off, and carry on

or even

3. if you know something that must be in the xml file, then show the hourglass, and loop trying to read that something from the xmldomdocument, until it succeeds - then turn the hourglass off and carryon - you just need to trap the error each time you test read the xml file
 

Users who are viewing this thread

Back
Top Bottom