Create XML file from string (in cells) with excel

I've made an excel file that creates xml statements. I would like to make a macro that creates an xml file and fills it with the xml statement that already exists as a string.

Additional background info: My excel file creates xml statements with concatenates. So far I was just copying the value of the cell and it worked just fine but because of the 34k character limit I need to divide my formula into 6-7 cells. I thought it would be good to make a macro not to have to copy/paste 7 times.

Thanks, JG


if you already have a string with the data you need to write, then an open ... print ... close would work.

eg

Open "C;MyPathMyFile.xml" For Output As #1
print #1, DataString
Close #1

If you search help for Open , then you would need to look at the vba version: MSDN

If you want to do something more fancy, then looking at the file system object: fso on MSDN

链接地址: http://www.djcxy.com/p/27762.html

上一篇: 编辑Excel工作表的特定单元格

下一篇: 使用excel从字符串(在单元格中)创建XML文件