Jump to content

Need to open a XML file using Excel but it needs to open as an XML list.


 Share

Recommended Posts

I can open the file using _ExcelBookOpen without a problem. But the file opens as a read-only workbook, the first tag of the element is used like a title and is placed in cell A1. The rest of the tags are sorted alphabetically and placed across the second row, like /area/city.

If I open the xml file by hand I receive a popup asking "Please select how you want to open this file: As an xml list, As a read-only workbook, or Us the xml source task pane."

When the file is opened as an XML list it is much cleaner looking. All the extra garbage found in the read-only excel file makes the data near useless.

Any help here would be appreciated.

Link to comment
Share on other sites

I can open the file using _ExcelBookOpen without a problem. But the file opens as a read-only workbook, the first tag of the element is used like a title and is placed in cell A1. The rest of the tags are sorted alphabetically and placed across the second row, like /area/city.

If I open the xml file by hand I receive a popup asking "Please select how you want to open this file: As an xml list, As a read-only workbook, or Us the xml source task pane."

When the file is opened as an XML list it is much cleaner looking. All the extra garbage found in the read-only excel file makes the data near useless.

Any help here would be appreciated.

Why are you bothering with Excel? You should work directly with MSXML as in eltorro's _XMLDOMWrapper.au3 UDF.

At any rate, this looks promising but I don't have Excel 2003 or above to test here:

; Default format
$oExcel.Workbooks.OpenXML("c:\sample.xml")

; Open as list
$oExcel.Workbooks.OpenXML('Filename:="c:\sample.xml"', 'LoadOption:=XlXmlLoadOption.xlXmlLoadImportToList')

:)

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...