Not importing XML data into Excel correctly

I have an Excel macro in which I run to import data from a XML file. Lately I've added some extra elements to the XML file and now it's not importing the data correctly.

In the XML file there are 3 sub elements for every main element:


The main element would have a time stamp within it and the other elements would have text.

When the 3 sub elements are blank the macro runs fine, but when one if the sub element has data within it the macro fails.

Try running the elements just with the main elements having a time stamp within them and then add some text to the sub elements and it shouldn't work.

Not sure what is happening.

Richard KreidlSoftware DeveloperAsked:
Who is Participating?
KoenChange and Transition ManagerCommented:
i can add text after <TestA_BI> without it crashing if I write it like this:

I have however no clue if that is the format you want/need...
KoenChange and Transition ManagerCommented:
the only thing I see is that as soon as you add text to the sub elements your n.length becomes 0

It is then logical that your For iNode = 0 to n.Length - 1 returns an error...
Richard KreidlSoftware DeveloperAuthor Commented:
I understand what you're saying. Is there a solution to fix this issue while still maintaining the XML file sub- elements as they are?
Richard KreidlSoftware DeveloperAuthor Commented:
Thanks for helping me out on this issue.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.