First of all, since there is no information, I will take the script for work and try to achieve what you need. You may need to tweak the code a bit to fit your needs, but that gives you a basis for working.
Since your XML feed does not contain additional data, a table containing email addresses will not add rows to the rest of the table as you want. My suggestion is that you use vba code to do this work.
Assuming you have the following xml file:
<?xml version="1.0" encoding="UTF-8"?> <Email> <address> teste@teste.com </address> <address> teste1@teste.com </address> <address> teste2@teste.com </address> <address> teste3@teste.com </address> <address> teste4@teste.com </address> <address> teste6@teste.com </address> </Email>
Using the following code, you will create a table in a worksheet:
Const xmlFileUrl As String = "c:\filePath\note.xml" Sub ClearXmlMaps() Dim existingXmlMap As XmlMap For Each existingXmlMap In ActiveWorkbook.XmlMaps existingXmlMap.Delete Next existingXmlMap End Sub Sub CreateMailList() Dim xmlTable As XmlMap ClearXmlMaps Application.WindowState = xlNormal ActiveWorkbook.XmlImport URL:=xmlFileUrl, ImportMap:=Nothing, Overwrite:=True, Destination:=Range("$A$1") Set xmlTable = ActiveWorkbook.XmlMaps(1) xmlTable.Name = "EmailList" End Sub
The code generated the red square part of the table below:

And I added a new column called "Name". Now suppose I want to update my XML stream without clearing all the column name information. To do this, I will use the auxiliary sheet (my main sheet here is βDataβ, and the auxiliary sheet is the βAuxβ sheet) to copy all the data, update the feed and finally replenish my table with the last state using the VLOOKUP command, for example, below:
Sub RefreshEmailList() Dim existingXmlMap As XmlMap Dim dataSheet As Worksheet Dim auxSheet As Worksheet Set dataSheet = ThisWorkbook.Worksheets("Data") Set auxSheet = ThisWorkbook.Worksheets("Aux") dataSheet.Cells.Copy auxSheet.Cells(1, 1) auxSheet.Range(auxSheet.Cells(1, 1), auxSheet.Cells(auxSheet.Cells(auxSheet.Rows.Count, 1).End(xlUp).Row, auxSheet.Cells(1, auxSheet.Columns.Count).End(xlToLeft).Column)).Value = auxSheet.Range(auxSheet.Cells(1, 1), auxSheet.Cells(auxSheet.Cells(auxSheet.Rows.Count, 1).End(xlUp).Row, auxSheet.Cells(1, auxSheet.Columns.Count).End(xlToLeft).Column)).Value dataSheet.Range(dataSheet.Cells(2, 2), dataSheet.Cells(dataSheet.Cells(dataSheet.Rows.Count, 1).End(xlUp).Row, dataSheet.Cells(1, dataSheet.Columns.Count).End(xlToLeft).Column)).Clear For Each existingXmlMap In ThisWorkbook.XmlMaps If existingXmlMap.Name = "EmailList" Then ActiveWorkbook.XmlMaps("EmailList").DataBinding.Refresh End If Next existingXmlMap dataSheet.Range(dataSheet.Cells(2, 2), dataSheet.Cells(dataSheet.Cells(dataSheet.Rows.Count, 1).End(xlUp).Row, dataSheet.Cells(1, dataSheet.Columns.Count).End(xlToLeft).Column)).FormulaR1C1 = "=IFERROR(IF(VLOOKUP([@address],Aux!C1:C,COLUMN(),FALSE) = 0 , """", VLOOKUP([@address],Aux!C1:C,COLUMN(),FALSE)), """")" dataSheet.Range(dataSheet.Cells(2, 2), dataSheet.Cells(dataSheet.Cells(dataSheet.Rows.Count, 1).End(xlUp).Row, dataSheet.Cells(1, dataSheet.Columns.Count).End(xlToLeft).Column)).Value = dataSheet.Range(dataSheet.Cells(2, 2), dataSheet.Cells(dataSheet.Cells(dataSheet.Rows.Count, 1).End(xlUp).Row, dataSheet.Cells(1, dataSheet.Columns.Count).End(xlToLeft).Column)).Value End Sub
If you change the xml file to the following:
<?xml version="1.0" encoding="UTF-8"?> <Email> <address> teste@teste.com </address> <address> teste1@teste.com </address> <address> teste2@teste.com </address> <address> teste3@teste.com </address> <address> teste4@teste.com </address> <address> teste5@teste.com </address> <address> teste6@teste.com </address> </Email>
And then run the RefreshEmailList () routine, you will get the result below:

The solution above works to add or remove rows, but you should know two things:
- Updating an XML feed using the refresh button will not result in an event
- This solution does not preserve the old states, which means that if one e-mail is deleted and then added again, information about this user may be lost.