Anyone know if you can embed a macro in an xml file?
I have an xml file that I create with a .net web application and it opens with Excel 2007, but would be nice to attach a macro to it as well. I want to attach a macro to this xml file programmatically. So that when I open this xml file in Excel 2007 than the macro runs aut开发者_如何学运维omatically
Thanks.
You cannot embed a macro in an Excel 2007 XML file. It isn't supported. You also cannot embed a macro in an xlsx file, security requirements prohibit it.
To embed a macro you have to use a xlsm file. Howerever, even though most of xlsm is text wrapped in a zip, the macro project itself is a binary file.
精彩评论