gpt4 book ai didi

vba - Libre Office Calc 与 Excel

转载 作者:行者123 更新时间:2023-12-04 19:56:09 25 4
gpt4 key购买 nike

我的公司将从 Excel 更改为 Libre Office Calc。我建立了一组 Excel VBA 宏(尤其是屏幕抓取宏)。我的宏可以在不做任何更改的情况下工作吗?还有人改过吗,怎么改的比较顺利?

最佳答案

Rubber Duck 可能已经回答了https://stackoverflow.com/a/24749320/7326037

From LibreOffice's online help file:

With a few exceptions, Microsoft Office and LibreOffice cannot run the same macro code. Microsoft Office uses VBA (Visual Basic for Applications) code, and LibreOffice uses Basic code based on the LibreOffice API (Application Program Interface) environment. Although the programming language is the same, the objects and methods are different.

The most recent versions of LibreOffice can run some Excel Visual Basic scripts if you enable this feature at LibreOffice - PreferencesTools - Options - Load/Save - VBA Properties. In reality, you would most likely need to sit down with the LibreOffice API and rewrite the functionality.

这篇文章还建议部分 VBA 宏可以工作,但需要一些手动迁移。 https://ask.libreoffice.org/en/question/6621/import-ms-word-macros/?answer=6982#post-id-6982

In ODF/ODS files you have to enable VBA support at the beginning of the macro, otherwise it expects LO-Basic:

Option VBASupport 1
Option Compatible

最终,您可能必须检查每一个并检查它是否正常运行。

关于vba - Libre Office Calc 与 Excel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43802220/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com