2 Replies Latest reply on Aug 12, 2006 11:56 PM by Matlus

    Open Excel file containing XML data using ActionScript

    ambirwar Level 1
      Hi All,

      I have XML file with data. I want to put this XML data into Excel file and want to launch or open this Excel file without storing it on Clipboard using Flex2 ActionScript or Flash ActionScript. Could somebody provide me the solution for this.

        • 1. Re: Open Excel file containing XML data using ActionScript
          peterent Level 2
          This type of direct communication is not possible with the Flash Player. All the Flash Player has access to is the clipboard and that is really limited to text.

          You can use the Flex 2 ExternalInterface API to communicate between Flex (Flash Player) and the browser. I don't know if it is possible to launch an application using JavaScript, but that would be how to do it.

          If Flex has loaded the XML, then the XML must be on a server, even if it is a web server. If it turns out it is possible to launch Excel from the browser using JavaScript, it is probable (but I do not know for sure) that you can get Excel to read the same XML file from the server using the same URL that Flex used.

          All this is speculation on my part, so you have to sometimes look for elaborate alternatives.
          • 2. Re: Open Excel file containing XML data using ActionScript
            Matlus Level 1
            I assume you know how to create an instance of Excel using JavaScript.
            I assume you can find your way around the browser DOM using JavaScript.

            Your options are:
            1. Excel can load the xml file directly given a url (so you're getting Excel to load a file given a url using JavaScript)
            2. If you have the xml file in Flex you can use the ExternalInterface API to create an xml document (using the xml string from Flex) and then load this document into Excel using JavaScript.