{"id":2593,"date":"2016-03-18T06:05:53","date_gmt":"2016-03-18T06:05:53","guid":{"rendered":"http:\/\/www.ericwhite.com\/home2\/bm8qcmjy\/public_html\/blog\/?page_id=2593"},"modified":"2016-03-20T14:09:30","modified_gmt":"2016-03-20T14:09:30","slug":"precisely-calculating-cell-sizes-in-open-xml-spreadsheetml","status":"publish","type":"page","link":"https:\/\/www.ericwhite.com\/blog\/precisely-calculating-cell-sizes-in-open-xml-spreadsheetml\/","title":{"rendered":"Precisely Calculating Cell Sizes in Open XML SpreadsheetML"},"content":{"rendered":"<p><span class=\"Back\"><a class=\"Back\" href=\"https:\/\/www.ericwhite.com\/blog\/introduction-to-spreadsheetml-series\/\">Return to the SpreadsheetML Screen-Cast Series<\/a><\/span>Sometimes you need to calculate the cell sizes (in pixels) exactly<br \/>\nin an Open XML spreadsheet.&nbsp; The most common use case is when placing graphics on a worksheet.&nbsp; You also need cell sizes in pixels when placing controls.&nbsp; In addition, understanding exactly how column widths and row heights work can help when<br \/>\ngenerating spreadsheets.&nbsp; You can create spreadsheets that look exactly as you want.<\/p>\n<p>The following screen-cast walks through the markup that controls column widths and row heights.&nbsp;It discusses the exact algorithm to calculate pixel dimensions.&nbsp; If you are an Open XML spreadsheet developer, you will want to know how this markup works.<\/p>\n<p>In the next screen-cast, I&rsquo;ll show how to precisely place images on a worksheet.<\/p>\n<p>Download: <a href=\"https:\/\/www.ericwhite.com\/blog\/wp-content\/uploads\/2016\/03\/XlsxCellDimensions.zip\">Example Code<\/a><br \/>\n<iframe loading=\"lazy\" title=\"Calculating-Cell-Sizes.wmv\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/zgO_vOfThCI?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Return to the SpreadsheetML Screen-Cast SeriesSometimes you need to calculate the cell sizes (in pixels) exactly in an Open XML spreadsheet.&nbsp; The most common use case is when placing graphics on a worksheet.&nbsp; You also need cell sizes in pixels when placing controls.&nbsp; In addition, understanding exactly how column widths and row heights work can [&hellip;]<\/p>\n","protected":false},"author":10567,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"_s2mail":"","footnotes":""},"class_list":["post-2593","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/pages\/2593","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/users\/10567"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/comments?post=2593"}],"version-history":[{"count":1,"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/pages\/2593\/revisions"}],"predecessor-version":[{"id":2596,"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/pages\/2593\/revisions\/2596"}],"wp:attachment":[{"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/media?parent=2593"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}