West
West

Reputation: 2570

How to add a comment to a cell in Excel using Xlwings

Im trying to add a comment to cell A1 with the following code and this causes the jupyter notebook to freeze. On restarting I notice an empty comment was inserted on A1.

sht.range("A1").api.AddComment="My comment"

How can I add a comment to a cell? The actual VBA is

sht.Range("A1").AddComment "My comment"

Upvotes: 3

Views: 1062

Answers (1)

West
West

Reputation: 2570

Solved it.

sht.range("A1").api.AddComment(Text="My Comment")

Upvotes: 5

Related Questions