最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - Xlwings Converting a Cell to an Excel DataType (e.g., Stocks, Currencies) - Stack Overflow

programmeradmin1浏览0评论

I'm trying to setup a command using Xlwings within a Python script to set a specific cell within an Excel worksheet to an Excel Data type (e.g., Stocks, Currencies). I've found the VBA code that sets to these "newer" Excel Data types that return values from Microsoft's online services. However I'm not having any luck in getting this code to work.

Any feedback would be appreciated.

Using: MacOS: Sequoia v15.1 Excel: Excel for Mac 2021

Sample code:

wb = xw.Book(file)
sheet = wb.sheets('Stock_DataTable')

sheet.Range("B19").api.ConvertToLinkedDataType ServiceID:=268435456, LanguageCulture:= "en-US"

Expected result: format the cell as the specified data type and return the correct information from the web-service

Observed result: the call simply fails with a message saying that this is not a supported function.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论