Method
shp=sht.api.Shapes.AddCallout(2, 110, 40, 200, 60)
shp.TextFrame2.TextRange.Characters.Text=’Test Box’
shp.Callout.Accent=True
shp.Callout.Border=True
shp.Callout.Angle=2
Sample Code
#Assign a formula as a name
import xlwings as xw #Import the xlwings package
import os #Import the os package
root = os.getcwd() #Get the current path
#Create an Excel application window, visible,
#without opening a workbook
app=xw.App()
bk=app.books.active
sht=bk.api.Sheets(1) #Get the worksheet
#Assign a formula as a name
sht.Range('A1:C3').Value=10
sht.Names.Add(Name='SM',RefersTo='=SUM($A$1:$C$3)')
sht.Range('D4').Formula='=SM+3'
#bk.save()
#bk.close()
#app.kill()

Leave a Reply