开发者

Adding a macro to an Excel spreadsheet with Java

开发者 https://www.devze.com 2023-03-03 02:56 出处:网络
I\'m developping an app that creates an Excel spreadsheet. I\'m using Java with docx4j library, but it does not have Macro support since it is not provided through Open XML API. I was just wondering i

I'm developping an app that creates an Excel spreadsheet. I'm using Java with docx4j library, but it does not have Macro support since it is not provided through Open XML API. I was just wondering if anyone knew of a workaround to add a macro to an existing Excel spreadsheet u开发者_运维百科sing Java (even with another library).

Thanks


If it's the same macro in all Workbooks you might be able to use a template? Meaning you have an empty workbook which contains the generalized makro and this will be copied for each "new" Workbook your need to create from Java.


I don't think you'll find anything java-based that will be able to do this for you. However I guess native MS technologies (.NET, c# etc) will be able to do this. Although (AFAIK) you can't actually execute c# in the JVM, you can make system calls from java to execute another program using Runtime.exec().

0

精彩评论

暂无评论...
验证码 换一张
取 消