最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

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

matteradmin8PV0评论

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.

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far