{"id":11767,"date":"2019-07-17T09:26:51","date_gmt":"2019-07-17T00:26:51","guid":{"rendered":"https:\/\/elleneast.com\/?p=11767"},"modified":"2019-08-22T19:52:47","modified_gmt":"2019-08-22T10:52:47","slug":"%e3%80%90vb-net%e3%80%91closedxml%ef%bc%9a%e3%83%86%e3%83%bc%e3%83%96%e3%83%ab%e3%81%ae%e4%bd%9c%e6%88%90%ef%bc%88%ef%bc%92%ef%bc%89","status":"publish","type":"post","link":"https:\/\/elleneast.com\/?p=11767","title":{"rendered":"\u3010VB.NET\u3011ClosedXML\uff1a\u30c6\u30fc\u30d6\u30eb\u306e\u4f5c\u6210\uff08\uff12\uff09"},"content":{"rendered":"[include-page id=\u201d11760\u2033]\n<p>\u4e0b\u56f3\u306e\u3088\u3046\u306a\u8868\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/elleneast.com\/wp\/wp-content\/uploads\/programming_topics\/ClosedXML\/ClosedXml_05.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11794 bigshadow\" src=\"https:\/\/elleneast.com\/wp\/wp-content\/uploads\/programming_topics\/ClosedXML\/ClosedXml_05.png\" alt=\"\" width=\"903\" height=\"193\" srcset=\"https:\/\/elleneast.com\/wp\/wp-content\/uploads\/programming_topics\/ClosedXML\/ClosedXml_05.png 903w, https:\/\/elleneast.com\/wp\/wp-content\/uploads\/programming_topics\/ClosedXML\/ClosedXml_05-300x64.png 300w, https:\/\/elleneast.com\/wp\/wp-content\/uploads\/programming_topics\/ClosedXML\/ClosedXml_05-768x164.png 768w\" sizes=\"auto, (max-width: 903px) 100vw, 903px\"><\/a><\/p>\n<p>&nbsp;<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">\u76ee\u6b21<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/elleneast.com\/?p=11767\/#%E3%83%AF%E3%83%BC%E3%82%AF%E3%83%96%E3%83%83%E3%82%AF%E3%81%AE%E4%BD%9C%E6%88%90\" >\u30ef\u30fc\u30af\u30d6\u30c3\u30af\u306e\u4f5c\u6210<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/elleneast.com\/?p=11767\/#%E3%83%AF%E3%83%BC%E3%82%AF%E3%82%B7%E3%83%BC%E3%83%88%E3%81%AE%E8%BF%BD%E5%8A%A0\" >\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u306e\u8ffd\u52a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/elleneast.com\/?p=11767\/#%E3%83%86%E3%82%AD%E3%82%B9%E3%83%88%E3%81%AE%E8%BF%BD%E5%8A%A0\" >\u30c6\u30ad\u30b9\u30c8\u306e\u8ffd\u52a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/elleneast.com\/?p=11767\/#%E3%83%96%E3%83%BC%E3%83%AB%E5%80%A4%E3%80%81%E6%97%A5%E4%BB%98%E3%80%81%E6%95%B0%E5%80%A4%E3%81%AE%E8%BF%BD%E5%8A%A0\" >\u30d6\u30fc\u30eb\u5024\u3001\u65e5\u4ed8\u3001\u6570\u5024\u306e\u8ffd\u52a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/elleneast.com\/?p=11767\/#%E7%AF%84%E5%9B%B2%E3%81%AE%E6%8C%87%E5%AE%9A\" >\u7bc4\u56f2\u306e\u6307\u5b9a<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/elleneast.com\/?p=11767\/#%E6%97%A5%E4%BB%98%E3%81%A8%E6%95%B0%E5%AD%97%E3%81%AE%E6%9B%B8%E5%BC%8F%E8%A8%AD%E5%AE%9A\" >\u65e5\u4ed8\u3068\u6570\u5b57\u306e\u66f8\u5f0f\u8a2d\u5b9a<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/elleneast.com\/?p=11767\/#%E8%A1%A8%E3%82%BF%E3%82%A4%E3%83%88%E3%83%AB%E3%81%AE%E3%82%BB%E3%83%AB%E3%81%AE%E6%9B%B8%E5%BC%8F%E3%82%92%E4%B8%80%E5%BA%A6%E3%81%AB%E8%A8%AD%E5%AE%9A\" >\u8868\u30bf\u30a4\u30c8\u30eb\u306e\u30bb\u30eb\u306e\u66f8\u5f0f\u3092\u4e00\u5ea6\u306b\u8a2d\u5b9a<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/elleneast.com\/?p=11767\/#%E8%A1%A8%E3%82%BF%E3%82%A4%E3%83%88%E3%83%AB%E3%81%AE%E3%82%BB%E3%83%AB%E3%82%92%E7%B5%90%E5%90%88\" >\u8868\u30bf\u30a4\u30c8\u30eb\u306e\u30bb\u30eb\u3092\u7d50\u5408<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/elleneast.com\/?p=11767\/#%E3%83%98%E3%83%83%E3%83%80%E3%83%BC%EF%BC%88%E5%88%97%E3%82%BF%E3%82%A4%E3%83%88%E3%83%AB%EF%BC%89%E3%81%AE%E6%9B%B8%E5%BC%8F\" >\u30d8\u30c3\u30c0\u30fc\uff08\u5217\u30bf\u30a4\u30c8\u30eb\uff09\u306e\u66f8\u5f0f<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/elleneast.com\/?p=11767\/#%E3%83%87%E3%83%BC%E3%82%BF%E9%83%A8%E5%88%86%E3%81%AE%E3%83%86%E3%83%BC%E3%83%96%E3%83%AB%E3%82%92%E4%BD%9C%E6%88%90\" >\u30c7\u30fc\u30bf\u90e8\u5206\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/elleneast.com\/?p=11767\/#%E5%A4%AA%E3%81%84%E7%BD%AB%E7%B7%9A%E3%82%92%E8%BF%BD%E5%8A%A0\" >\u592a\u3044\u7f6b\u7dda\u3092\u8ffd\u52a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/elleneast.com\/?p=11767\/#%E3%82%B3%E3%83%B3%E3%83%86%E3%83%B3%E3%83%84%E3%81%AB%E5%90%88%E3%82%8F%E3%81%9B%E3%81%A6%E5%88%97%E5%B9%85%E3%82%92%E8%AA%BF%E6%95%B4\" >\u30b3\u30f3\u30c6\u30f3\u30c4\u306b\u5408\u308f\u305b\u3066\u5217\u5e45\u3092\u8abf\u6574<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/elleneast.com\/?p=11767\/#%E3%83%AF%E3%83%BC%E3%82%AF%E3%83%96%E3%83%83%E3%82%AF%E3%82%92%E4%BF%9D%E5%AD%98\" >\u30ef\u30fc\u30af\u30d6\u30c3\u30af\u3092\u4fdd\u5b58<\/a><\/li><\/ul><\/nav><\/div>\n<h2 id=\"i-0\"><span class=\"ez-toc-section\" id=\"%E3%83%AF%E3%83%BC%E3%82%AF%E3%83%96%E3%83%83%E3%82%AF%E3%81%AE%E4%BD%9C%E6%88%90\"><\/span>\u30ef\u30fc\u30af\u30d6\u30c3\u30af\u306e\u4f5c\u6210<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre class=\"lang:vbnet decode:true \">Dim wb = New XLWorkbook<\/pre>\n<h2 id=\"i-1\"><span class=\"ez-toc-section\" id=\"%E3%83%AF%E3%83%BC%E3%82%AF%E3%82%B7%E3%83%BC%E3%83%88%E3%81%AE%E8%BF%BD%E5%8A%A0\"><\/span>\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u306e\u8ffd\u52a0<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre class=\"lang:vbnet decode:true \">Dim ws = wb.Worksheets.Add(\"\u65e5\u672c\u306e\u5854\")<\/pre>\n<h2 id=\"i-2\"><span class=\"ez-toc-section\" id=\"%E3%83%86%E3%82%AD%E3%82%B9%E3%83%88%E3%81%AE%E8%BF%BD%E5%8A%A0\"><\/span>\u30c6\u30ad\u30b9\u30c8\u306e\u8ffd\u52a0<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre class=\"lang:vbnet decode:true \">'\u8868\u30bf\u30a4\u30c8\u30eb\nws.Cell(\"B2\").Value = \"\u65e5\u672c\u306e\u5854\"\n\n'\u540d\u79f0\nDim fieldTitle_name As String = \"\u540d\u79f0\"\nws.Cell(\"B3\").Value = fieldTitle_name\nws.Cell(\"B4\").Value = \"\u6771\u4eac\u30bf\u30ef\u30fc\uff08\u65e5\u672c\u96fb\u6ce2\u5854\uff09\"\nws.Cell(\"B5\").Value = \"\u6771\u4eac\u30b9\u30ab\u30a4\u30c4\u30ea\u30fc\"\nws.Cell(\"B6\").SetValue(\"\u660e\u77f3\u6d77\u5ce1\u5927\u6a4b\uff08\u4e3b\u5854\uff09\") '\u5024\u8a2d\u5b9a\u306e\u5225\u306e\u3084\u308a\u65b9\n\n'\u6240\u5728\u5730\nDim fieldTitle_location As String = \"\u6240\u5728\u5730\"\nws.Cell(\"C3\").Value = fieldTitle_location\nws.Cell(\"C4\").Value = \"\u6771\u4eac\u90fd\u6e2f\u533a\u829d\u516c\u5712\"\nws.Cell(\"C5\").Value = \"\u6771\u4eac\u90fd\u58a8\u7530\u533a\u62bc\u4e0a\u4e00\u4e01\u76ee\"\nws.Cell(\"C6\").SetValue(\"\u6de1\u8def\u5e02 - \u795e\u6238\u5e02\u9593\") '\u5024\u8a2d\u5b9a\u306e\u5225\u306e\u3084\u308a\u65b9<\/pre>\n<h2 id=\"i-3\"><span class=\"ez-toc-section\" id=\"%E3%83%96%E3%83%BC%E3%83%AB%E5%80%A4%E3%80%81%E6%97%A5%E4%BB%98%E3%80%81%E6%95%B0%E5%80%A4%E3%81%AE%E8%BF%BD%E5%8A%A0\"><\/span>\u30d6\u30fc\u30eb\u5024\u3001\u65e5\u4ed8\u3001\u6570\u5024\u306e\u8ffd\u52a0<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre class=\"lang:vbnet decode:true\">'\u96fb\u6ce2\u5854\u304b\uff1f\uff08\u30d6\u30fc\u30eb\u5024\uff09\nDim fieldTitle_isRadioTower As String = \"\u96fb\u6ce2\u5854\"\nws.Cell(\"D3\").Value = fieldTitle_isRadioTower\nws.Cell(\"D4\").Value = True\nws.Cell(\"D5\").Value = True\nws.Cell(\"D6\").SetValue(False) '\u5024\u8a2d\u5b9a\u306e\u5225\u306e\u3084\u308a\u65b9\n\n'\u7ae3\u5de5\u30fb\u958b\u901a\u65e5\uff08\u65e5\u4ed8\uff09\nDim fieldTitle_completionDate As String = \"\u7ae3\u5de5\u30fb\u958b\u901a\u65e5\"\nws.Cell(\"E3\").Value = fieldTitle_completionDate\nws.Cell(\"E4\").Value = New DateTime(1958, 12, 23)\nws.Cell(\"E5\").Value = New DateTime(2012, 2, 29)\nws.Cell(\"E6\").SetValue(New DateTime(1998, 4, 5)) '\u5024\u8a2d\u5b9a\u306e\u5225\u306e\u3084\u308a\u65b9\n\n'\u9ad8\u3055\uff08\u6570\u5024\uff09\nDim fieldTitle_height As String = \"\u9ad8\u3055\"\nws.Cell(\"F3\").Value = fieldTitle_height\nws.Cell(\"F4\").Value = 333\nws.Cell(\"F5\").Value = 634\nws.Cell(\"F6\").SetValue(298.3) '\u5024\u8a2d\u5b9a\u306e\u5225\u306e\u3084\u308a\u65b9<\/pre>\n<h2 id=\"i-4\"><span class=\"ez-toc-section\" id=\"%E7%AF%84%E5%9B%B2%E3%81%AE%E6%8C%87%E5%AE%9A\"><\/span>\u7bc4\u56f2\u306e\u6307\u5b9a<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre class=\"lang:vbnet decode:true \">'\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u304b\u3089\u6307\u5b9a\nDim rngTable = ws.Range(\"B2:F6\")\n\n'\u4ed6\u306e\u7bc4\u56f2\u304b\u3089\u6307\u5b9a\nDim rngDates = rngTable.Range(\"D3:D5\") '\u30a2\u30c9\u30ec\u30b9\u306f rngTable \u306b\u5bfe\u3059\u308b\u76f8\u5bfe\u4f4d\u7f6e\uff08\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u306b\u5bfe\u3059\u308b\u4f4d\u7f6e\u3067\u306f\u306a\u3044\uff09\nDim rngNumbers = rngTable.Range(\"E3:E5\") '\u30a2\u30c9\u30ec\u30b9\u306f rngTable \u306b\u5bfe\u3059\u308b\u76f8\u5bfe\u4f4d\u7f6e\uff08\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u306b\u5bfe\u3059\u308b\u4f4d\u7f6e\u3067\u306f\u306a\u3044\uff09<\/pre>\n<h2 id=\"i-5\"><span class=\"ez-toc-section\" id=\"%E6%97%A5%E4%BB%98%E3%81%A8%E6%95%B0%E5%AD%97%E3%81%AE%E6%9B%B8%E5%BC%8F%E8%A8%AD%E5%AE%9A\"><\/span>\u65e5\u4ed8\u3068\u6570\u5b57\u306e\u66f8\u5f0f\u8a2d\u5b9a<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre class=\"lang:vbnet decode:true \">'OpenXML \u306e\u5b9a\u7fa9\u6e08\u307f\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\uff08d-mmm-yy\uff09\u3002\n'rngDates.Style.NumberFormat.NumberFormatId = 15\n\n'\u30e6\u30fc\u30b6\u30fc\u5b9a\u7fa9\u306e\u66f8\u5f0f\u8a2d\u5b9a\nrngDates.Style.NumberFormat.Format = \"yyyy\u5e74MM\u6708dd\u65e5\"\nrngNumbers.Style.NumberFormat.Format = \"#,##0.0 \"\"m\"\"\"<\/pre>\n<h2 id=\"i-6\"><span class=\"ez-toc-section\" id=\"%E8%A1%A8%E3%82%BF%E3%82%A4%E3%83%88%E3%83%AB%E3%81%AE%E3%82%BB%E3%83%AB%E3%81%AE%E6%9B%B8%E5%BC%8F%E3%82%92%E4%B8%80%E5%BA%A6%E3%81%AB%E8%A8%AD%E5%AE%9A\"><\/span>\u8868\u30bf\u30a4\u30c8\u30eb\u306e\u30bb\u30eb\u306e\u66f8\u5f0f\u3092\u4e00\u5ea6\u306b\u8a2d\u5b9a<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre class=\"lang:vbnet decode:true \">rngTable.FirstCell().Style _\n    .Font.SetBold() _\n    .Fill.SetBackgroundColor(XLColor.FromArgb(191,191,191)) _\n    .Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)<\/pre>\n<h2 id=\"i-7\"><span class=\"ez-toc-section\" id=\"%E8%A1%A8%E3%82%BF%E3%82%A4%E3%83%88%E3%83%AB%E3%81%AE%E3%82%BB%E3%83%AB%E3%82%92%E7%B5%90%E5%90%88\"><\/span>\u8868\u30bf\u30a4\u30c8\u30eb\u306e\u30bb\u30eb\u3092\u7d50\u5408<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre class=\"lang:vbnet decode:true \">rngTable.FirstRow().Merge() 'rngTable.Range(\"A1:E1\").Merge() \u307e\u305f\u306f rngTable.Row(1).Merge() \u3067\u3082OK\u3002<\/pre>\n<h2 id=\"i-8\"><span class=\"ez-toc-section\" id=\"%E3%83%98%E3%83%83%E3%83%80%E3%83%BC%EF%BC%88%E5%88%97%E3%82%BF%E3%82%A4%E3%83%88%E3%83%AB%EF%BC%89%E3%81%AE%E6%9B%B8%E5%BC%8F\"><\/span>\u30d8\u30c3\u30c0\u30fc\uff08\u5217\u30bf\u30a4\u30c8\u30eb\uff09\u306e\u66f8\u5f0f<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre class=\"lang:vbnet decode:true\">Dim rngHeaders = rngTable.Range(\"A2:E2\") '\u30a2\u30c9\u30ec\u30b9\u306f rngTable \u306b\u5bfe\u3059\u308b\u76f8\u5bfe\u4f4d\u7f6e\uff08\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u306b\u5bfe\u3059\u308b\u4f4d\u7f6e\u3067\u306f\u306a\u3044\uff09\nrngHeaders.Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center\nrngHeaders.Style.Font.Bold = True\nrngHeaders.Style.Font.FontColor = XLColor.DarkBlue\nrngHeaders.Style.Fill.BackgroundColor = XLColor.Aqua<\/pre>\n<h2 id=\"i-9\"><span class=\"ez-toc-section\" id=\"%E3%83%87%E3%83%BC%E3%82%BF%E9%83%A8%E5%88%86%E3%81%AE%E3%83%86%E3%83%BC%E3%83%96%E3%83%AB%E3%82%92%E4%BD%9C%E6%88%90\"><\/span>\u30c7\u30fc\u30bf\u90e8\u5206\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre class=\"lang:vbnet decode:true   \">Dim rngData = ws.Range(\"B3:F6\")\nDim excelTable = rngData.CreateTable\n'\u30b7\u30fc\u30c8\u4e0a\u306b\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3057\u305f\u304f\u306a\u3044\u304c\u3001\u7bc4\u56f2\u3092\u30c6\u30fc\u30d6\u30eb\u3068\u3057\u3066\u6271\u3044\u305f\u3044\u5834\u5408\u306f rngData.AsTable \u3092\u4f7f\u3046\u3002\n\n'\u300c\u5408\u8a08\u300d\u7528\u306e\u884c\u3092\u8ffd\u52a0\nexcelTable.ShowTotalsRow = true\n'\u300c\u9ad8\u3055\uff08\u30e1\u30fc\u30c8\u30eb\uff09 \u300d\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u5e73\u5747\u3092\u8a08\u7b97\n'\u5217\u306e\u540d\u524d\u3092\u4f7f\u7528\u3057\u3066\u76ee\u7684\u306e\u30bb\u30eb\u3092\u64cd\u4f5c\u3057\u3066\u3044\u308b\u70b9\u306b\u6ce8\u76ee\nexcelTable.Field(fieldTitle_height).TotalsRowFunction = XLTotalsRowFunction.Average\n'\u300c\u5408\u8a08\u300d\u7528\u306e\u884c\u306e\u300c\u7ae3\u5de5\u30fb\u958b\u901a\u65e5\u300d\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u30e9\u30d9\u30eb\u3092\u5165\u529b\nexcelTable.Field(fieldTitle_completionDate).TotalsRowLabel = \"\u5e73\u5747:\"\nexcelTable.Field(fieldTitle_completionDate).TotalsCell.Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Right) '\u53f3\u5bc4\u305b<\/pre>\n<h2 id=\"i-10\"><span class=\"ez-toc-section\" id=\"%E5%A4%AA%E3%81%84%E7%BD%AB%E7%B7%9A%E3%82%92%E8%BF%BD%E5%8A%A0\"><\/span>\u592a\u3044\u7f6b\u7dda\u3092\u8ffd\u52a0<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre class=\"lang:vbnet decode:true \">'\u30b7\u30fc\u30c8\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u306b\u592a\u3044\u7f6b\u7dda\u3092\u8ffd\u52a0\nws.RangeUsed().Style.Border.OutsideBorder = XLBorderStyleValues.Thick\n\n'\u305d\u308c\u305e\u308c\u306e\u8fba\u306e\u7f6b\u7dda\u3092\u6307\u5b9a\u3059\u308b\u5834\u5408\n'contents.FirstColumn().Style.Border.LeftBorder = XLBorderStyleValues.Thick\n'contents.LastColumn().Style.Border.RightBorder = XLBorderStyleValues.Thick\n'contents.FirstRow().Style.Border.TopBorder = XLBorderStyleValues.Thick\n'contents.LastRow().Style.Border.BottomBorder = XLBorderStyleValues.Thick<\/pre>\n<h2 id=\"i-11\"><span class=\"ez-toc-section\" id=\"%E3%82%B3%E3%83%B3%E3%83%86%E3%83%B3%E3%83%84%E3%81%AB%E5%90%88%E3%82%8F%E3%81%9B%E3%81%A6%E5%88%97%E5%B9%85%E3%82%92%E8%AA%BF%E6%95%B4\"><\/span>\u30b3\u30f3\u30c6\u30f3\u30c4\u306b\u5408\u308f\u305b\u3066\u5217\u5e45\u3092\u8abf\u6574<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre class=\"lang:vbnet decode:true \">'\u30b3\u30f3\u30c6\u30f3\u30c4\u304c\u65e5\u672c\u8a9e\u306e\u5834\u5408\u306f\u65e5\u672c\u8a9e\u30d5\u30a9\u30f3\u30c8\u306b\u3057\u3066\u304a\u304b\u306a\u3044\u3068 AdjustToContents \u304c\u6b63\u3057\u304f\u52d5\u4f5c\u3057\u306a\u3044\nws.Style.Font.FontName = \"\u6e38\u30b4\u30b7\u30c3\u30af\";\nws.Columns().AdjustToContents\n\n'\u6b21\u306e\u3088\u3046\u306b\u3057\u3066\u5217\u7bc4\u56f2\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u308b\n'ws.Columns(2, 6).AdjustToContents \u307e\u305f\u306f ws.Columns(\"2-6\").AdjustToContents<\/pre>\n<h2 id=\"i-12\"><span class=\"ez-toc-section\" id=\"%E3%83%AF%E3%83%BC%E3%82%AF%E3%83%96%E3%83%83%E3%82%AF%E3%82%92%E4%BF%9D%E5%AD%98\"><\/span>\u30ef\u30fc\u30af\u30d6\u30c3\u30af\u3092\u4fdd\u5b58<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre class=\"lang:vbnet decode:true \">wb.SaveAs(\"D:\\test\\TowersInJapan.xlsx\")<\/pre>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/elleneast.com\/?cat=90\">\u300c\u3010VB.NET\u3011ClosedXML \u306e\u4f7f\u3044\u65b9\u300d\u306e\u4e00\u89a7\u3092\u8868\u793a<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>[include-page id=\u201d11760\u2033] \u4e0b\u56f3\u306e\u3088\u3046\u306a\u8868\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 &nbsp; \u30ef\u30fc\u30af\u30d6\u30c3\u30af\u306e\u4f5c\u6210 Dim wb = New XLWorkbook \u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u306e\u8ffd\u52a0 Dim ws = wb.Worksh &#8230; <\/p>\n","protected":false},"author":1,"featured_media":2656,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[90],"tags":[],"class_list":{"0":"post-11767","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-closedxml"},"_links":{"self":[{"href":"https:\/\/elleneast.com\/index.php?rest_route=\/wp\/v2\/posts\/11767","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/elleneast.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elleneast.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elleneast.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/elleneast.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11767"}],"version-history":[{"count":3,"href":"https:\/\/elleneast.com\/index.php?rest_route=\/wp\/v2\/posts\/11767\/revisions"}],"predecessor-version":[{"id":12958,"href":"https:\/\/elleneast.com\/index.php?rest_route=\/wp\/v2\/posts\/11767\/revisions\/12958"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/elleneast.com\/index.php?rest_route=\/wp\/v2\/media\/2656"}],"wp:attachment":[{"href":"https:\/\/elleneast.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11767"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elleneast.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11767"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elleneast.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11767"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}