Share via

Cannot change stylesheet for Excel XML File

Anonymous
2025-05-21T20:19:06+00:00

I am opening an xml doc and need to apply a specific stylesheet. I used one found here https://github.com/HL7/CDA-core-xsl/blob/master/CDA.xsl but is incorrect. Ever since opening it using this file, I am unable to select a different style sheet. This CDA.xsl is the only option that is showing up.

Microsoft 365 and Office | Excel | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Anonymous
    2025-05-27T00:57:41+00:00

    Dear Customer,

    Regarding this issue, since you have already checked everything possible from your end but the problem persists, we believe an engineer should take a closer look. Please reach out to Microsoft Support

    Contact Microsoft Support

    • Ticket Support: Visit Microsoft Support and sign in to submit a support request.
    • Phone Support: Microsoft provides customer service phone numbers based on your region. You can find the appropriate contact number here.

    Best regards, 

    Hoang-D - MSFT | Microsoft Community Support Specialist

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2025-05-21T21:46:18+00:00

    Hi thank you - it is working but now all my xml documents have the line pointing to the cda.xsl. I'd have to open each individual file and point to the correct xsl file or remove the line altogether. I have hundreds of these xml files i need to open

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2025-05-21T21:02:57+00:00

    Hi SangThao,

    Thank you for posting on Microsoft Community. I understand that you’re having trouble changing the stylesheet associated with your XML file in Excel. Once you open an XML file in Excel and associate it with a stylesheet (XSL or XSLT), Excel “remembers” that association and does not easily allow switching to a different stylesheet for that file.Here’s how you can regain control and apply a different stylesheet to your XML file:1. Remove the Stylesheet Processing Instruction from the XMLOpen your XML file in a text editor (like Notepad or VS Code) and look for a line near the top like:

    • Delete this line, or change the href to the path of your new stylesheet.
    • Save the XML file.
    • Now, when you open the XML in Excel, it should prompt you to select a stylesheet again.

    ****2. Open the XML in Excel Without Stylesheet

    • Open Excel.
    • Go to File > Open and select your XML file.
    • If prompted, choose As an XML table (not as a read-only workbook).
    • If Excel does not prompt for a stylesheet, it’s because of the processing instruction. Remove it as described above.

    3. Use “Open With” and Specify the StylesheetIf you want to force Excel to use a different stylesheet:

    • Make a copy of your XML file.
    • In the copy, update the  line to point to your desired XSL file.
    • Open this new XML file in Excel.

    For reference: Overview of XML in Excel - Microsoft Support If none of the above solutions work, let me know for further investigation. Please note that our initial response does not always resolve the issue immediately. However, with your help and more detailed information, we can work together to find a solution.

    Kind regards,

    Hoang-D - MSFT | Microsoft Community Support Specialist

    Was this answer helpful?

    0 comments No comments