Add a macro to an Excel spreadsheet using Java

I am developing an application that creates an Excel spreadsheet. I use Java with docx4j , but it does not have Macro support, as it is not provided through the Open XML API. I'm just wondering if anyone knew of a workaround for adding macros to an existing Excel spreadsheet using Java (even with a different library).

thanks

+6
source share
2 answers

If this is the same macro in all books, can you use a template? This means that you have an empty workbook that contains a generic macro, and this will be copied for each β€œnew” workbook that you need to create with Java.

+3
source

I don't think you will find anything based on java that can do this for you. However, I assume that they will be able to use their own MS technologies (.NET, C #, etc.). Although (AFAIK) you cannot actually execute C # in the JVM, you can make system calls from java to execute another program using Runtime.exec () .

+2
source

Source: https://habr.com/ru/post/887440/


All Articles