Ok so i have these 6 which are coerced during Running-time as String Values. So these lines below are String values
bdx-20131231.xml
bdx-20131231.xsd
bdx-20131231_cal.xml
bdx-20131231_def.xml
bdx-20131231_lab.xml
bdx-20131231_pre.xml
inside a macro we have a small simple loop that iterates and prints on the immediate window the string values that end with ".xml" so the xsd (second one) is not printed by the loop. Following you can see the loop
For Each el In IE.Document.getelementsbytagname("a")
If el.href Like "*.xml" Then
Debug.Print el.innertext, el.href
End If
next el
So we are left with these
bdx-20131231.xml
bdx-20131231_cal.xml
bdx-20131231_def.xml
bdx-20131231_lab.xml
bdx-20131231_pre.xml
However what i am trying to nail here is the XBRL INSTANCE DOCUMENT
which has no letters at the end of it's naming it's bdx- numbers_only
so it's the first one that interests us only.
However the statement... Like "*.xml"
grabs and prints both 5 in the immediate window.
The first thing that came to my mind is ok split in two the bdx-20131231.xml
and use the function IsNumeric
on the second part after the hyphen however the value is coerced.
How can we make the loop pick only the first one bdx-20131231.xml
?
For reasons of completeness you can see the whole code which the loop comes from here.
Courtesy of Tim Williams