Sub LerXml(ByVal strFolderPath As String)
'Declaração de variaveis de objeto para leitura do XML
Dim xmlDoc As DOMDocument
Dim xmlList As IXMLDOMNodeList
Dim xmlNode As IXMLDOMNode
'Declaração de variaveis diversas para o código
Dim shtXml As Worksheet
Dim strXml As String
Dim x, y, i As Long
Dim objPasta As FileDialog
'Declaração de variaveis de retorno do XML
Dim strNumerII As String
Dim strDtaSitu As String
Dim strNomSitu As String
'Carregando Planilha
Set shtXml = ThisWorkbook.Sheets("LerXml")
'Atribuindo caminho do arquivo a variavel
strXml = strFolderPath
'Carregando o objeto que irá representar o documento XML
Set xmlDoc = New DOMDocument
'Carregando o arquivo
xmlDoc.Load (strXml)
'Capturando a ultima linha da planilha
i = shtXml.Range("A1048576").End(xlUp).Row + 1
'Aqui vamos iniciar a ler os produtos da nota fiscal e carregar as linhas no excel conforme esses produtos
Set xmlList = xmlDoc.getElementsByTagName("li-simplificada")
For Each xmlNode In xmlList
'Capturando dados do xml
strNumerII = GetNodeValue(xmlNode, "numero-li")
strDtaSitu = GetNodeValue(xmlNode, "data-situacao")
strNomSitu = GetNodeValue(xmlNode, "nome-situacao")
'Carregando informações na planilha
shtXml.Cells(i, 1).Value = strNumerII
shtXml.Cells(i, 2).Value = strDtaSitu
shtXml.Cells(i, 3).Value = strNomSitu
'Incrementando a linha
i = i + 1
Next
Set shtXml = Nothing
Set xmlList = Nothing
Set xmlNode = Nothing
Set xmlDoc = Nothing
End Sub