EXCEL : Export in XML file format

Hello,

I want to save an Excel spreadsheet in XML format.

To do it, I've done this script :

--- CODE

set File_In to choose file "Choose an Excel file"

tell application "Microsoft Excel"
open File_In
save File_In in "test.xml" as XML spreadsheet
end tell


tell application "Microsoft Excel"
quit saving no
end tell

--- END CODE

Do you know a better way to do it ?

Thanks

Imac 24 and MacBook...iPhone not yet !, Mac OS X (10.4.10)

Posted on Oct 19, 2007 8:36 AM

Reply
Question marked as Top-ranking reply

Posted on Oct 19, 2007 5:21 PM

tell application "Microsoft Excel"
save (open (choose file "Choose an Excel file")) in "test.xml" as XML spreadsheet
quit saving no
end tell

... or ...

tell application "Microsoft Excel" to save (open (choose file "Choose an Excel file")) in "test.xml" as XML spreadsheet
tell application "Microsoft Excel" to quit saving no
4 replies
Question marked as Top-ranking reply

Oct 19, 2007 5:21 PM in response to Henri Dominique Rapin

tell application "Microsoft Excel"
save (open (choose file "Choose an Excel file")) in "test.xml" as XML spreadsheet
quit saving no
end tell

... or ...

tell application "Microsoft Excel" to save (open (choose file "Choose an Excel file")) in "test.xml" as XML spreadsheet
tell application "Microsoft Excel" to quit saving no

Oct 20, 2007 11:26 AM in response to Henri Dominique Rapin

I'm using Excel to create an XML file from a text file. Do you know a better way to do it ?


Ahh, so your question relates to options for creating XML files, not better ways to drive Excel. That was not clear in your original post.

Ultimately, XML is nothing more than a structured text format. You can create an XML file by hand using the standard AppleScript write command, although you are responsible for properly formatting the data before you write it out.

Alternatively there are a few AppleScript OSAXen (extensions/additions) that are designed around working with XML. One is Late Night's XMLTools which provide AppleScript commands that can read, format and write XML within your script, without needing to use a whole separate program like Excel.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

EXCEL : Export in XML file format

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.