Method
shp=sht.api.Shapes.AddShape(1, 200, 50, 200, 100) #Rectangular area
shp2=sht.api.Shapes.AddShape(9, 150, 70, 200, 100) #Elliptical area
ff=shp2.Fill
ff.ForeColor.RGB= xw.utils.rgb_to_int((255,0,0)) #Set elliptical area to red
ff.Transparency=0.7 #Transparency 0.7
Sample Code
#Text Properties
import xlwings as xw #Import xlwings package
app=xw.App()
bk=app.books.active #Get the active workbook
sht=bk.sheets.active #Get the active worksheet
sht.api.Range('C3').Value='Font Test123'
ft=sht.api.Range('C3').Font
ft.Name = 'Times New Roman'
ft.ColorIndex = 3
ft.Size = 20
ft.Bold=True
ft.Strikethrough = False
ft.Underline = 5
ft.Italic=True
#bk.save()
#bk.close()
#app.kill()

Leave a Reply