简体   繁体   中英

Embed an macro to Excel 2007 xml

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 automatically

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM