Export File to .xml?

BigLRIP

Board Regular
Joined
May 7, 2009
Messages
123
Hello all,

My company uses what we call a "whitelist" file that is stored in .xml format. It's a single-column file that uses XML tags.

My task is to create this .xml file based off an excel database. Excel has 3 columns titled match, scope, and url. From these columns I am to generate the .xml file. A snippet of our .xml file looks like this (ignore the ||'s):

<||TrackingEntry>
<||UrlMatch match=regex scope=full>offer\.ebay\.com/ws/ebayisapi\.dll\?.*makequickbid</UrlMatch>
<||/TrackingEntry>
<||TrackingEntry>
<||UrlMatch match=regex scope=full>facebook\.com/ajax/emu/end\.php\?eid=<||/UrlMatch>
<||/TrackingEntry>
<||TrackingEntry>


I've gotten to the point where I can recreate the lines of the .xml file within a single column on a single sheet in its own workbook. However, I am having serious difficulties when it comes to saving it as .xml.

When I save it as .xml, theres a bunch of garbage (excel metadata?) that makes the file completely unreadable. Is there any way to do this? The file looks clean when I save it as .txt...

Thank you


EDIT ---> This must be done in VBA
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
A better alternative would probably be to copy my data into a text file, then save that text file as .xml.

Is this possible with VBA?
 
Upvote 0

Forum statistics

Threads
1,224,616
Messages
6,179,911
Members
452,949
Latest member
beartooth91

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top