{"id":65,"date":"2026-02-16T17:49:42","date_gmt":"2026-02-16T09:49:42","guid":{"rendered":"https:\/\/xlwings.net\/blog\/?p=65"},"modified":"2026-01-17T06:15:52","modified_gmt":"2026-01-17T06:15:52","slug":"how-to-create-callout-using-xlwings","status":"publish","type":"post","link":"https:\/\/xlwings.net\/blog\/how-to-create-callout-using-xlwings\/","title":{"rendered":"How To Create Callout Using xlwings?"},"content":{"rendered":"<h2>Method<\/h2>\n<p>Use the `AddCallout` method of the `Shapes` object to add a callout. The syntax is:\u00a0<\/p>\n<p>\u00a0<\/p>\n<p>sht.api.Shapes.AddCallout(Type,Left,Top,Width,Height)<\/p>\n<p>\u00a0<\/p>\n<p>Where `sht` represents a worksheet object. The parameters are explained in the table below. This method returns a `Shape` object representing the callout.<\/p>\n<p>\u00a0<\/p>\n<p>The `Type` parameter values are from the `MsoCalloutType` enumeration, which specifies the type of the callout line.<\/p>\n<p>\u00a0<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p>Name<\/p>\n<\/td>\n<td>\n<p>Value<\/p>\n<\/td>\n<td>\n<p>Description<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>msoCalloutFour<\/p>\n<\/td>\n<td>\n<p>4<\/p>\n<\/td>\n<td>\n<p>A callout line composed of two segments, attached to the right of the text box<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>msoCalloutMixed<\/p>\n<\/td>\n<td>\n<p>-2<\/p>\n<\/td>\n<td>\n<p>A mixed combination of states<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>msoCalloutOne<\/p>\n<\/td>\n<td>\n<p>1<\/p>\n<\/td>\n<td>\n<p>A single-segment horizontal callout line<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>msoCalloutThree<\/p>\n<\/td>\n<td>\n<p>3<\/p>\n<\/td>\n<td>\n<p>A callout line composed of two segments, attached to the left of the text box<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>msoCalloutTwo<\/p>\n<\/td>\n<td>\n<p>2<\/p>\n<\/td>\n<td>\n<p>A single-segment angled callout line<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u00a0<\/p>\n<p>shp=sht.api.Shapes.AddCallout(2, 10, 10, 100, 50)<\/p>\n<p>shp.TextFrame2.TextRange.Characters.Text=&#8217;Test Box&#8217;<\/p>\n<h2>Sample Code<\/h2>\n\n\n<pre class=\"wp-block-code\"><code>#Assign a formula as a name\n\nimport xlwings as xw    #Import the xlwings package\nimport os    #Import the os package\n\nroot = os.getcwd()    #Get the current path\n#Create an Excel application window, visible, \n#without opening a workbook  \napp=xw.App()\nbk=app.books.active\nsht=bk.api.Sheets(1)    #Get the worksheet\n\n#Assign a formula as a name\nsht.Range('A1:C3').Value=10\nsht.Names.Add(Name='SM',RefersTo='=SUM($A$1:$C$3)')\nsht.Range('D4').Formula='=SM+3'\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=\"774\" height=\"482\" src=\"https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/02\/63.png\" alt=\"Create Callout Using xlwings\" class=\"wp-image-386\" srcset=\"https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/02\/63.png 774w, https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/02\/63-300x187.png 300w, https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/02\/63-768x478.png 768w\" sizes=\"auto, (max-width: 774px) 100vw, 774px\" \/><\/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-65","post","type-post","status-publish","format-standard","hentry","category-xlwings-shape"],"_links":{"self":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/65","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=65"}],"version-history":[{"count":3,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/65\/revisions"}],"predecessor-version":[{"id":387,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/65\/revisions\/387"}],"wp:attachment":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/media?parent=65"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/categories?post=65"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/tags?post=65"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}