PDA

View Full Version : XML parsing in VBA on Mac



SmartSpider
05-23-2007, 07:13 PM
Hello All,

I've been writing VBA macros for a few years - always for MS Excel on Windows OS, but now I am faced with a challenge of extending help to someone who needs to run a macro I wrote to parse an XML file on a Mac. The macro I wrote simply uses the msxml.dll in reference and creates objects of DOMDocument and IXMLDOMNode in the code to parse the xml and extract required data. However this is failing when run on a Mac.

I have never worked on Mac and don't even have access to one, can someone help me to find a way to read and parse an xml file in a macro that would run on a Mac?

Thanks,
~SS

lucas
05-23-2007, 09:07 PM
Hi Smart,
I moved this to the Mac specific forum where I think you will get better help for your problem. Don't do Mac myself so I can't help you there. I left a redirect from the excel forum so if anyone sees it there they can follow the thread here if they think they can help.

SmartSpider
05-23-2007, 09:28 PM
Thanks Lucas!

shades
05-24-2007, 11:02 AM
Howdy. Rick Schaut (MS MacBU) wrote on one aspect of this (when commenting on the converter planned for XL2008):



Rick Schaut (http://blogs.msdn.com/rick_schaut) Says:
December 7th, 2006 at 4:20 pm (http://www.schwieb.com/blog/2006/12/05/conversion-factors/#comment-5270) ,
With respect to libXml, there are some additional points worth considering:

1) 18 months ago, we hadn?t made the decision of the minium OS version that Office 12 was going to support.

2) Shipping an updated version of an open source library is a non-starter, for one simple reason: if there?s a security flaw in the version we ship, we?re on the hook for that security issue without having ownership of the code. The potential legal issues are too risky to allow us to go down that route.

3) We need more than just SAX2 compliance. We also need DOM support on the write side.

4) LibXML?s APIs all use UTF8 for string arguments (or, at least, the libXML that shipped with Panther did). MSXML uses UTF16. Since Win Office is written to MSXML, we?d either have to rewrite considerable portions of the code we port from Win Office, or write UTF16 wrappers around the API?s and the callbacks.

All of those combined to make a difficult decision fall on the MSXML side of the fence.

shades
05-24-2007, 11:04 AM
Here is the entire dialog (http://www.schwieb.com/blog/2006/12/05/conversion-factors/#comment-5270) related to this topic, where Rick continues to elaborate on the differences between the two LibXML and MSXML.

shades
05-24-2007, 11:07 AM
As a further comment, XML support in Office 2004 for Mac is minimal at best.