Opening XML file with an XSL stylesheet

G

Gary E.

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?
 
D

Dsuperc

Gary E. said:
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?
 
G

Gary E.

If I open it this way, it is the same effect as right-clicking and selecting
Excel to open. That is, Excel asks me if I want to use the stylesheet. I need
Excel to use the stylesheet without prompting me.

Gary
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top