TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Call Python functions from VBA in all Microsoft Office apps

75 点作者 fzumstein超过 6 年前

8 条评论

sonofgod超过 6 年前
A couple of years ago I played with xlwings, but found it too slow for our usecase (a few cells modified per second) plus we found the Windows requirement quite onerous.<p>I wound up reading&#x2F;writing our spreadsheets in pure Python -- we used xlwt which doesn&#x27;t support xlsx, so I&#x27;d probably consider using openpyxl these days.<p>(Specifically we were selecting parts of spreadsheets based on row&#x2F;column headers inside the spreadsheet even if they weren&#x27;t in the first row&#x2F;column or there were multiple tables per tab; if this sounds useful to you check out <a href="https:&#x2F;&#x2F;github.com&#x2F;sensiblecodeio&#x2F;xypath" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;sensiblecodeio&#x2F;xypath</a> )
评论 #18167660 未加载
montenegrohugo超过 6 年前
Does anyone have any current info on native Python support in Excel? I recall Microsoft announcing they would offer this at some point in the future. I would really really prefer it to VBA.
评论 #18166820 未加载
评论 #18166906 未加载
评论 #18166808 未加载
alphadelphi超过 6 年前
Cool, but I find even cooler the native support in LibreOffice, IIRC. <a href="https:&#x2F;&#x2F;wiki.documentfoundation.org&#x2F;Macros&#x2F;Python_Guide" rel="nofollow">https:&#x2F;&#x2F;wiki.documentfoundation.org&#x2F;Macros&#x2F;Python_Guide</a>
AdmiralAsshat超过 6 年前
It&#x27;s getting to the point where simply opening a Microsoft Office document is roughly the same as opening a random .exe file.<p>I think we should treat them with the same kind of paranoia.
评论 #18167618 未加载
fzumstein超过 6 年前
16 seconds demo: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=KXzG3LBZEWI" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=KXzG3LBZEWI</a>
nuclx超过 6 年前
The other direction is more interesting: Generating&#x2F;templating Word or Excel documents using the COM interface using the comtypes&#x2F;win32com python packages. That&#x27;s what I currently use to generate release documentation as part of a delivery pipeline.
yread超过 6 年前
You can also call C# functions using <a href="https:&#x2F;&#x2F;excel-dna.net" rel="nofollow">https:&#x2F;&#x2F;excel-dna.net</a>
评论 #18167348 未加载
评论 #18167193 未加载
Bishonen88超过 6 年前
cool, was wondering if it&#x27;s still maintained (last big update from May).<p>Something I was wondering: If xlwings reads a big chunck of data in a dataframe, is there a way to keep it in memory without the need to re-load it every time one wants to do something with it?
评论 #18168786 未加载