{"id":78,"date":"2026-02-23T11:03:58","date_gmt":"2026-02-23T03:03:58","guid":{"rendered":"https:\/\/xlwings.net\/blog\/?p=78"},"modified":"2026-01-17T10:29:25","modified_gmt":"2026-01-17T10:29:25","slug":"how-to-set-face-properties-using-xlwings-solid-fill","status":"publish","type":"post","link":"https:\/\/xlwings.net\/blog\/how-to-set-face-properties-using-xlwings-solid-fill\/","title":{"rendered":"How To Set Face Properties Using xlwings? &#8211; Solid Fill"},"content":{"rendered":"<h2>Method<\/h2>\n<p>In Excel, a face is represented by the `FillFormat` object. You can access this object via the `Fill` property of a `Shape` object and then programmatically set its properties.\u00a0<\/p>\n<p>\u00a0<\/p>\n<p>You can specify the color using the `ForeColor` property and apply a solid fill using the `Solid` method.<\/p>\n<p>\u00a0<\/p>\n<p>shp=sht.api.Shapes.AddShape(9, 100, 50, 200, 100)<\/p>\n<p>ff=shp.Fill<\/p>\n<p>ff.ForeColor.RGB= xw.utils.rgb_to_int((255,0,0))<\/p>\n<h2>Sample Code<\/h2>\n\n\n<pre class=\"wp-block-code\"><code>#Area properties - Solid color fill\n\nimport xlwings as xw    #Import xlwings package\n\napp=xw.App()\nbk=app.books.active   #Get the active workbook\nsht=bk.sheets.active    #Get the active worksheet\n\nshp=sht.api.Shapes.AddShape(9, 100, 50, 200, 100)\nff=shp.Fill\nff.ForeColor.RGB= xw.utils.rgb_to_int((255,0,0))\n\n#bk.save()\n#bk.close()\n#app.kill()<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"786\" height=\"482\" src=\"https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/02\/image-6.png\" alt=\"Set Face Properties Using xlwings? - Solid Fill\" class=\"wp-image-431\" srcset=\"https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/02\/image-6.png 786w, https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/02\/image-6-300x184.png 300w, https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/02\/image-6-768x471.png 768w\" sizes=\"auto, (max-width: 786px) 100vw, 786px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Method<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-78","post","type-post","status-publish","format-standard","hentry","category-xlwings-shape"],"_links":{"self":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/78","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/comments?post=78"}],"version-history":[{"count":2,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/78\/revisions"}],"predecessor-version":[{"id":432,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/78\/revisions\/432"}],"wp:attachment":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/media?parent=78"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/categories?post=78"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/tags?post=78"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}