在 Perl 中生成引用第 3 方插件函数的 Excel 电子表格
我正在尝试使用 Spreadsheet::SimpleExcel 生成一个 xls 文件,该文件调用在第三方加载项(彭博社,如果重要的话)中定义的函数。底层的 WriteExcel 包不允许我写出这个,因为它不知道这个插件函数。我看到模块知道的内置函数的巨大哈希表,并且可能会将此函数添加到其中,但我不知道该函数的属性,尤其是“ptg 代码”。
有没有办法确定这个第三方函数的 ptg 代码(我假设这类似于操作码),或者有什么方法可以欺骗模块让我写出这些函数而不必知道这些函数细节?或者我没有想到的第三个计划?
I am trying to generate an xls file with Spreadsheet::SimpleExcel that calls a function that is defined in a third party add in (Bloomberg, if it matters). The underlying WriteExcel package does not let me write this out because it does not know about this add-in function. I see the giant hash table of built-in functions that the module knows about and could potentially add this function to it, but I don't know the attributes of the function, especially the 'ptg code'.
Is there a way to either determine what the ptg code (I assume this is something like an opcode) of this third-party function, or is there some way to trick the module into letting me write out these functions without it having to know these details? Or some third plan that I haven't thought of?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Spreadsheet::WriteExcelXML 和 Excel::Writer::XLSX 应该能够使用第三方函数生成 Excel 文件。
这两个模块都使用与 Spreadsheet::WriteExcel 相同的界面,但功能较少。
Spreadsheet::WriteExcelXML and Excel::Writer::XLSX should be able to generate Excel files with third party functions.
Both modules use the same interface as Spreadsheet::WriteExcel although with fewer features.
我认为你需要使用 Win32::OLE 并且它有点混乱。尝试:
其中 $xll_path 是 Bloomberg 的 xll 的完整路径,$xll_file 只是 xll 名称。
I think you need to use Win32::OLE and it's a bit messy. Try:
where $xll_path is the full path to the xll for Bloomberg and $xll_file is just the xll name.