locked
Open an xml file with Internet Explorer using an xsl file RRS feed

  • Question

  • Using Vba I need to open an xml file with Internet Explorer.

    How can I do?

    Thanks

    Marco Dell'Oca

    Wednesday, October 28, 2020 4:50 PM

Answers

  • FollowHyperlink will only work if IE is defined as your default application for handling xml files.

    You should be able to do something like

    Sub IE_OpenXML(sXMLFile As String)
        Dim oIE                   As Object    'SHDocVw.InternetExplorer

        Set oIE = CreateObject("InternetExplorer.Application")
        With oIE
            .Navigate sXMLFile
            .Visible = True
        End With

        Set oIE = Nothing
    End Sub

    Then simply call it

    Call IE_OpenXML("C:\...\...\...\YourFileName.xml")


    Daniel Pineault, 2010-2019 Microsoft MVP
    Professional Support: http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net

    • Marked as answer by Marco Dell'Oca Thursday, October 29, 2020 9:59 AM
    Wednesday, October 28, 2020 8:48 PM

All replies

  • In a web browser control within a form or in a standard IE instance?

    Daniel Pineault, 2010-2019 Microsoft MVP
    Professional Support: http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net

    Wednesday, October 28, 2020 5:27 PM
  • Hi Daniel

    In a standard IE instance.

    I tried with followHyperlink but it doesn't work.

    Also I would like to use an xsl file for how to view it.

    Thanks

    Marco Dell'Oca

    • Proposed as answer by Imb-hb Thursday, October 29, 2020 10:25 AM
    • Unproposed as answer by Imb-hb Thursday, October 29, 2020 10:25 AM
    Wednesday, October 28, 2020 5:48 PM
  • FollowHyperlink will only work if IE is defined as your default application for handling xml files.

    You should be able to do something like

    Sub IE_OpenXML(sXMLFile As String)
        Dim oIE                   As Object    'SHDocVw.InternetExplorer

        Set oIE = CreateObject("InternetExplorer.Application")
        With oIE
            .Navigate sXMLFile
            .Visible = True
        End With

        Set oIE = Nothing
    End Sub

    Then simply call it

    Call IE_OpenXML("C:\...\...\...\YourFileName.xml")


    Daniel Pineault, 2010-2019 Microsoft MVP
    Professional Support: http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net

    • Marked as answer by Marco Dell'Oca Thursday, October 29, 2020 9:59 AM
    Wednesday, October 28, 2020 8:48 PM
  • thank you very much Daniel

    Marco Dell'Oca

    Thursday, October 29, 2020 9:59 AM