ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Opening XML file with an XSL stylesheet (https://www.excelbanter.com/excel-discussion-misc-queries/67741-opening-xml-file-xsl-stylesheet.html)

Gary E.

Opening XML file with an XSL stylesheet
 
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?

Dsuperc

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?


Dsuperc

Opening XML file with an XSL stylesheet
 
If you have Excel 2003, just go File, open.

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


Gary E.

Opening XML file with an XSL stylesheet
 
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

"Dsuperc" wrote:

If you have Excel 2003, just go File, open.

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



All times are GMT +1. The time now is 04:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com