使用Java将一个宏添加到Excel电子表格 [英] Adding a macro to an Excel spreadsheet with Java
问题描述
我正在开发一个创建Excel电子表格的应用程序。我正在使用Java与 docx4j 库,但它没有宏支持,因为它不是通过Open XML API提供。我只是想知道是否有人知道使用Java(甚至使用另一个库)将现有Excel电子表格添加宏的解决方法。
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 using Java (even with another library).
谢谢
推荐答案
如果所有工作簿中的宏都相同,您可以使用模板?意思是你有一个空的工作簿,其中包含广义的makro,这将被复制为您需要从Java创建的每个新工作簿。
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.
这篇关于使用Java将一个宏添加到Excel电子表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!