(Solved) – XML multiline to single line using VBA


I have an excel file. One of the cells include an XML script. I need to fetch the contents of this cell and paste them in a notepad. I am done with everything except I am unable to have the entire XML script in one single line. No white spaces after and before tags and no new line characters. Please assist.
To maintain client data privacy, I have pasted below a sample XML script. This script is supposed to be in B7 cell of excel.

I cannot replace white spaces with nothing since I don’t want the white spaces between attributes to be replaced with nothing.

XML Script –


Leave a Reply

Your email address will not be published. Required fields are marked *