XML API in VBA under Excel?

D

David Thielen

Hi;

If this is the wrong forum, please tell me which forum to hit.

I am writing a VBA applet for Excel (and Excel only). By way of
background - I have a ton of experience writing C# (including Excel
AddIns) and Java - but never Basic before.

In the text of a cell I need to parse XML fragments and then get back
the element name and some specific attributes. The string I need to
parse will be one of the following 3 forms:

<data name='dave' type='int'>
<data name='dave' type='int'/>
</dave>

Is there an API in VBA where I can give it an XML fragment and then
get back the node name and attribute values? If so, what is the API
and anything specific I have to do to tell it that in 2 of the cases
it's an XML fragment.

Also, is this library always installed or do we need to install it if
it's not on a user's computer? This needs to run on Excel 2000, 2002,
2003, & 2007.

thanks - dave

david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
H

Harald Staff

Hi Dave

Set a reference (tools menu) to a Microsoft XML library and it should do it
for you. VBA language is VB6 language, so you'll find lots of code samples
on the web.

Nothing is always installed, at least not in the very same version. It is
called DLL hell. But if you code for an early version library, like MS XML
2.0, it should in theory work for all later versions as well. Likewise,
create your material in the earliest Excel version required, 2000 if I
understand this correct.

HTH. Best wishes Harald
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top