Copying macros (only) between workbooks (Java version)

Hi,

Since you now have support to copy macros between workbooks. Would it be possible to create a method for copying just the macros (and nothing else) between workbooks? This would be really helpful for us.

The basic scenario is that we receive a template from a customer that we need to add a certain macro to. If the suggested method is created we could easily store our macro in another template and just copy it into the file we received from our customer. As it is today to copy method replaces everything that exists in the target workbook.

Thanks and best regards,
Ulf Ekström

Hi,

Thank you for considering Aspose.

Aspose.Cells only preserves the macros when processing the workbooks. No manipulation of macros is allowed currently. Can you please explain in a bit detail that what kind of method are you looking for to copy the macros and what exactly is your requirement for copying macros between different workbooks? Then we will look into the feasibility of this feature and get back to you.

Thank You & Best Regards,

Hi,

The method I’m thinking about would take all macros from a source workbook and add them to a target workbook. We do not need to manipulate them in any way. Simply copy them from one workbook to another without changing anything else in the target workbook. If the target workbook already contains macros they should also be there after the copy operation has completed.

Thanks,
Ulf

Hi,

Thank you for considering Aspose.

Currently Aspose.Cells only preserves the macros when processing the workbooks. When copying Workbook, we just copy the preserved records of Macro with other unknown data to the new workbook. And for most macros, some other objects must be copied together to make the macros work properly, such as, the worksheets in the workbook.

So, for copying only macros to the target workbook without copying other data and preserving original macros in the target workbook, I am afraid, currently we cannot support this feature.

Thank You & Best Regards,

Ok, makes sense.

Best regards,
Ulf