{"id":17,"date":"2026-01-18T17:37:41","date_gmt":"2026-01-18T09:37:41","guid":{"rendered":"https:\/\/xlwings.net\/blog\/?p=17"},"modified":"2026-01-17T03:05:28","modified_gmt":"2026-01-17T03:05:28","slug":"general-process-of-using-xlwings","status":"publish","type":"post","link":"https:\/\/xlwings.net\/blog\/general-process-of-using-xlwings\/","title":{"rendered":"General Process of Using xlwings"},"content":{"rendered":"<h2>Method<\/h2>\n<h3>Import xlwings package<\/h3>\n<p>import xlwings as xw \u00a0\u00a0\u00a0<\/p>\n<h3>Create or get main objects<\/h3>\n<p>app=xw.App()<\/p>\n<p>bk=app.books.active \u00a0\u00a0\u00a0#Get the active workbook<\/p>\n<p>sht=bk.sheets.active\u00a0 \u00a0\u00a0#Get the active sheet<\/p>\n<h3>Data processing<\/h3>\n<p>sht.range(&#8216;A1&#8217;).value=10<\/p>\n<h3>Save the workbook, close it and exit<\/h3>\n<p>bk.close()<\/p>\n<p>app.kill()<\/p>\n<h2>Sample Code<\/h2>\n\n\n<pre class=\"wp-block-code\"><code>#General Process of Using the xlwings Package  \n\nimport xlwings as xw    #Import the xlwings package \n\napp=xw.App()    #Create an Excel application  \nbk=app.books.active    #Get the active workbook \nsht=bk.sheets.active    #Get the active worksheet  \n\n#Process data \nsht.range(\"A1\").value=10\n\n#Close the workbook\nbk.close()\n#Exit the application\napp.kill()<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"883\" height=\"482\" src=\"https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/01\/1.png\" alt=\"xlwings\" class=\"wp-image-115\" srcset=\"https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/01\/1.png 883w, https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/01\/1-300x164.png 300w, https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/01\/1-768x419.png 768w\" sizes=\"auto, (max-width: 883px) 100vw, 883px\" \/><\/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":[2],"tags":[],"class_list":["post-17","post","type-post","status-publish","format-standard","hentry","category-xlwings-application"],"_links":{"self":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/17","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=17"}],"version-history":[{"count":3,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/17\/revisions"}],"predecessor-version":[{"id":117,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/17\/revisions\/117"}],"wp:attachment":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/media?parent=17"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/categories?post=17"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/tags?post=17"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}