View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dsuperc
 
Posts: n/a
Default Opening XML file with an XSL stylesheet



"Gary E." wrote:

I have an XML file that has a stylesheet defined (<?xml:stylesheet...). I
want to get that data, as configured by the stylesheet, into Excel in some
fashion that I can automate.

If I right-click the file and select Excel to open it, Excel prompts to see
if I want to use the stylesheet; if I do, it opens the file fine; if I say I
don't want a stylesheet, then it opens the file but doesn't use the
stylesheet (I get just the raw XML data). But I don't know how to eliminate
the prompt and have Excel use the defined stylesheet by default.

I also tried opening the file in VBA using Workbooks.Open, but it doesn't
use the stylesheet.

I also tried importing the XML data with the Data..XML..Import command, but
again it doesn't use the stylesheet.

So how can I get the data from the XML file into Excel, using the stylesheet
defined in the XML file?