User
User

Reputation: 67

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.

Upvotes: 0

Views: 481

Answers (1)

Samuel Neff
Samuel Neff

Reputation: 74939

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.

Upvotes: 1

Related Questions