I'm trying to import an XML file into Excel using the Workbooks.OpenXML to load data through VBA. Two questions:
- Can this method be called by Excel for Mac?
- The second argument is an XSL stylesheet. I have tried pointing to the
.xslI have created that makes the XML flat, but I get Run-time error '5'. Is there a working example I can refer to to determine what I'm doing wrong?
Here is the working example:
Application.Workbooks.OpenXML _
Filename:="C:\Users\eric\Desktop\08D006606_251011_092651.uddf", _
LoadOption:=xlXmlLoadImportToList
This code throws the following error: Run-time error '5', Invalid procedure call or argument
Dim styleSheet as Variant
styleSheet = "C:\Users\eric\Desktop\XPD.xsl"
Application.Workbooks.OpenXML _
Filename:="C:\Users\eric\Desktop\08D006606_251011_092651.uddf", _
Stylesheets:=styleSheet, _
LoadOption:=xlXmlLoadImportToList