问题标签 [pyxll]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
33 浏览

python - 是否有机会通过使用 SQLAlchemy 触发对数据模型的某个字段的验证

然后我想有一个验证函数,AnForeignID通过在数据类中包含 func 来限制必填字段(下)

0 投票
0 回答
211 浏览

python - How can I use the Python language to put add-ins in Excel without using Pyxll or xlwings or VBA?

I am trying to figure out how to use Python-based functions in excel. I came across Pyxll which can make Python add-ins instead of using VBA. But Pyxll is not free after their 30-day trial.

I also came across xlwings which worked fine and served the purpose of adding udfs in excel, the problem is--- it is not very user-friendly. I have to put the excel file in the same folder as the python file plus, they should also have the same names with different extensions. Or I may use the xlwings quickstart command to do that.

This means I have to create such folders everytime I wish to include my python based functions in a new excel project file and copy paste the functions from the previous python files to the newly created quickstart files.

I was wondering if there is any way to use only one python file to import user-defined functions using xlwings or perhaps a different library/module which is free to use and does that?

(PS: According to the xlwings documentation, we can point to a udf module under the xlwings tab in excel but even after many attempts I am not able to make it work )

0 投票
1 回答
34 浏览

python - 如何使用 pyxll 函数在特定单元格坐标上放置多个列表

嗨,伙计们,我陷入了这种糟糕的境地,我必须在特定单元格坐标的 excel 中放置多个列表,并且在任何地方都找不到任何解决方案

当前实施:

此代码非常适用于一组数据。但现在我想在特定的单元格坐标上添加多个这样的数据集。如果可能的话,如下所示:

0 投票
1 回答
123 浏览

python - 从未保存的 excel 工作簿上的 python 函数调用时,RefreshAll 函数在 excel 上不起作用

我想通过按下功能区中的按钮来更新当前工作簿上的所有功能,但 refreshAll 功能不起作用。以下是映射到单击的按钮的 refresh_func 函数,该函数运行逻辑

可能存在未保存 excel 文件且用户想更新其工作表上的函数但不想保存它的情况。此外,解决方案不应强迫我保存或关闭文件以使解决方案正常工作或刷新功能

我对任何解决此问题的 github 软件包持开放态度。

0 投票
1 回答
52 浏览

python - Pyxll:TypeError 列表索引必须是整数或切片,而不是浮点数

在单元格 A1 的 excel 中,我有一个简单的文本 Hello World。

我在 Pyxll 中编写了简单的 UDF 函数:

示例图片

当我在 excel =get_txt(A1;" ";0) 中调用此函数时出现错误: TypeError 列表索引必须是整数或切片,而不是浮点数

但在 python 中,这段代码运行良好。请帮助如何解决此错误。谢谢大家的帮助。

0 投票
0 回答
38 浏览

python - 如何借助现有 Excel 文件上的插入按钮运行 python 脚本

我想通过单击插入的按钮对现有的 excel 文件进行一些计算。我的目标是为插入的按钮分配一个 python 脚本。当我单击插入的按钮时,计算将更新。我已经做了一些研究,可以使用 .xlsxwriter 插入一个按钮,但我无法使用 xlsxwriter 打开现有的 Excel 文件。

另一方面,我可以使用 .openpyxl 库加载现有的 Excel 文件,但它不允许我插入按钮。

.pyxll 库可以解决这个问题吗?

你能告诉我怎样才能达到我的目标吗?我应该使用哪个库或方法?

提前致谢!
问候

0 投票
0 回答
56 浏览

excel - 如何使用VBA隐藏和显示excel功能区上的按钮

大家好,我正在开发一个 excel 插件项目,该项目使用微软定义的功能区 xml结构添加自定义功能区。我在此功能区登录和注销上有 2 个按钮。现在,当加载 excel 时,我只想显示登录按钮,当用户登录时隐藏登录按钮并显示注销按钮。现在的挑战是我需要在运行 excel 时进行这些更改。而且我无法获得此隐藏和显示功能的任何参考

尽管该项目是在 python 中使用 pyxll 插件,但也可以合并任何 VBA 解决方案。我无法为我的问题找到任何文章或参考资料,因此我们将不胜感激。

0 投票
0 回答
17 浏览

pyxll - 使用 pyxl 转换 int 中的列

有没有人可以帮助找到一种方法将带有“,”的excel列中的值转换为值类型int。例如,我有 10,33 个非类型的女巫,我想用 python 将它转换为 int,比如 10.33。感谢您的帮助

0 投票
0 回答
65 浏览

python - 使用 Pyxll 提取 excel 公式/vba 代码以便在 python 中重写

我有一个大型 Excel/vba 工作簿(约 70 张,其中大多数是计算负载的数据表),需要将其转换为实际语言,因此可以将其打包为 Web 应用程序。一些逻辑在 VBA 中,但大部分实际上在 Excel 单元格/公式/表格中。

感觉足够大,可以考虑采用程序化方法。所以我一直在看Pyxll。我想到的是以下几行:

  1. 编写一个 python/pyxll 脚本,将表格/表格转换为类
  2. 对于这些表中的每一个,列将成为其他类和/或属性
  3. 单元格中的公式将被提取,命名范围将被转换为变量等。
  4. 根据这个处理写出python文件。
  5. 手动编辑/编写代码以使创建的骨架按照原始 Excel 程序实际工作。

似乎是一种可行的方法,因为 pyxll 声称能够与工作簿完全交互并且能够做 VBA 可以做的几乎任何事情。然而,文档/用例似乎主要是用另一种方式来解释的(例如,在 python 中实现可以在 Excel 中调用的东西)。

那里有任何pyxll电源使用吗?上面概述的计划是现实的,还是我更容易从头开始重写所有内容?

0 投票
0 回答
43 浏览

xlwings - 您可以使用 xlwings 使用自定义 python 代码创建一个完全独立的 xls 文件吗

我想使用 python 和 xlwings(或 pyxll 等替代方法)创建一些自定义 excel 函数。但是对于分发,我需要将 python 代码以及所有依赖项都嵌入到 excel 文件中,这样我只能将 excel 文件作为独立文件发送,并且当最终用户打开文件时,一切都可以开箱即用无需安装任何东西

这可能吗?

非常感谢!