I would like to ask if it's somehow possible to include some vba code in an XML file?
After an export of my excel file to xml I cannot see it.
My goal is to create excel with macros from xml.
I would like to ask if it's somehow possible to include some vba code in an XML file?
After an export of my excel file to xml I cannot see it.
My goal is to create excel with macros from xml.
I think you may be getting confused between saving an XML Data file and an Excel Add-In (you may have seen this called an XML Add-in).
By using Save As and selecting the XML Data file type, Excel will produce an XML file with the data contained only on your worksheets and so no VBA is saved. An Excel Add-In though is a file containing macro information so you can quite easily add the macros it contains to another installation of Excel, I believe this is the goal you are trying to achieve.
This webpage helped me a lot when I first learned how to create add-ins, and it also includes information on creating custom ribbon UI's for your macros; And this webpage contains instructions on adding / removing Add-ins.
PtrSafe after any Declare statements