{"id":7187,"date":"2016-08-09T14:20:46","date_gmt":"2016-08-09T05:20:46","guid":{"rendered":"https:\/\/www.ka-net.org\/blog\/?p=7187"},"modified":"2016-08-09T14:20:46","modified_gmt":"2016-08-09T05:20:46","slug":"powershell%e3%81%8b%e3%82%89closedxml%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6excel%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%82%92%e4%bd%9c%e6%88%90%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=7187","title":{"rendered":"PowerShell\u304b\u3089ClosedXML\u3092\u4f7f\u3063\u3066Excel\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>\u4ee5\u524dC#\u304b\u3089ClosedXML\u3092\u4f7f\u3063\u3066Excel\u30d5\u30a1\u30a4\u30eb\u3092\u64cd\u4f5c\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8a18\u4e8b\u3092\u66f8\u304d\u307e\u3057\u305f\u304c(\u4e0b\u8a18\u53c2\u7167)<br \/>\n\u3001\u4eca\u56de\u306fPowerShell\u304b\u3089ClosedXML\u3092\u547c\u3073\u51fa\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<div class=\"cardlink\"><a href=\"https:\/\/www.ka-net.org\/blog\/?p=6894\"><div class=\"cardlink_thumbnail\"><img src='https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/eyecatch-Excel-120x120.png' alt='ClosedXML\u3084EPPlus\u3067Excel\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u66f8\u304d\u3057\u3066\u307f\u305f\u3002' width=120 height=120 \/><\/a><\/div><div class=\"cardlink_content\"><span class=\"timestamp\">2016.04.15<\/span><div class=\"cardlink_title\"><a href=\"https:\/\/www.ka-net.org\/blog\/?p=6894\">ClosedXML\u3084EPPlus\u3067Excel\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u66f8\u304d\u3057\u3066\u307f\u305f\u3002 <\/a><\/div><div class=\"cardlink_excerpt\">\u4eca\u56de\u306e\u8a18\u4e8b\u306e\u767a\u7aef\u306f\u4e0b\u8a18\u306eQiita\u6295\u7a3f\u3002\r\n\r\n\r\n\u30fbExcel\u30d5\u30a1\u30a4\u30eb\u3092 C# \u3068 VB.NET \u3067\u8aad\u307f\u8fbc\u3080 \"\u6b63\u3057\u3044\" \u65b9\u6cd5 - Qiita\r\nhttp:\/\/qiita.com\/midori44\/items\/acab9106e6dad9653e73\r\n\r\n...<\/div><\/div><div class=\"cardlink_footer\"><\/div><\/div>\n<p><span style=\"color: #ff0000; font-weight: bold;\">\u203b \u4e0b\u8a18\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u524d\u306b\u300c<a href=\"https:\/\/www.nuget.org\/packages\/ClosedXML\/\" title=\"NuGet Gallery | ClosedXML 0.76.0\" target=\"_blank\">ClosedXML.dll<\/a>\u300d\u30d5\u30a1\u30a4\u30eb\u3068\u300c<a href=\"https:\/\/www.nuget.org\/packages\/DocumentFormat.OpenXml\/\" title=\"NuGet Gallery | DocumentFormat.OpenXml 2.5.0\" target=\"_blank\">DocumentFormat.OpenXml.dll<\/a>\u300d\u30d5\u30a1\u30a4\u30eb\u3092\u9069\u5f53\u306a\u30d5\u30a9\u30eb\u30c0\u306b\u7528\u610f\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/span><\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">&#x5B;Reflection.Assembly]::LoadFile(&quot;C:\\System\\OpenXML\\DocumentFormat.OpenXml.dll&quot;)\r\n&#x5B;Reflection.Assembly]::LoadFile(&quot;C:\\System\\ClosedXML\\ClosedXML.dll&quot;)\r\n$wb = New-Object ClosedXML.Excel.XLWorkbook\r\n#\u30b7\u30fc\u30c8\u8ffd\u52a0\r\n$ws = $wb.Worksheets.Add(&quot;Sample&quot;);\r\n#\u30d5\u30a9\u30f3\u30c8\u5909\u66f4\r\n$ws.Cell(1, 1).SetValue(&quot;\u3053\u3093\u306b\u3061\u306f\u3001\u4e16\u754c\u3002&quot;).Style.Font.SetFontName(&quot;Meiryo UI&quot;)\r\n#\u6587\u5b57\u8272\u5909\u66f4\r\n$ws.Cell(1, 2).SetValue(&quot;Hello world.&quot;).Style.Font.SetFontColor(&#x5B;ClosedXML.Excel.XLColor]::Aqua)\r\n#\u6587\u5b57\u8272\u5909\u66f4(16\u9032)\r\n$ws.Cell(1, 3).SetValue(123456).Style.Font.SetFontColor(&#x5B;ClosedXML.Excel.XLColor]::FromHtml(&quot;#FF9966CC&quot;))\r\n#\u4e2d\u592e\u63c3\u3048\r\n$ws.Range(&quot;A1:C1&quot;).Style.Alignment.Horizontal = &quot;Center&quot;;\r\n#\u5217\u5e45\u81ea\u52d5\u8abf\u6574\r\n$ws.Columns(1, 3).AdjustToContents()\r\n#\u540d\u524d\u3092\u4ed8\u3051\u3066\u4fdd\u5b58\r\n$wb.SaveAs(&quot;C:\\Test\\Sample_ClosedXML.xlsx&quot;)<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/PowerShell_ClosedXML_01.jpg\" alt=\"PowerShell_ClosedXML_01\" width=\"330\" height=\"178\" class=\"alignnone size-full wp-image-7188\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/PowerShell_ClosedXML_01.jpg 330w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/PowerShell_ClosedXML_01-300x162.jpg 300w\" sizes=\"auto, (max-width: 330px) 100vw, 330px\" \/><\/p>\n<p>\u7c21\u5358\u306a\u51e6\u7406\u3092\u66f8\u3044\u305f\u3060\u3051\u3067\u3059\u304c\u3001\u3084\u306f\u308aClosedXML\u306f\u76f4\u611f\u7684\u3067\u5206\u304b\u308a\u3084\u3059\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4ee5\u524dC#\u304b\u3089ClosedXML\u3092\u4f7f\u3063\u3066Excel\u30d5\u30a1\u30a4\u30eb\u3092\u64cd\u4f5c\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8a18\u4e8b\u3092\u66f8\u304d\u307e\u3057\u305f\u304c(\u4e0b\u8a18\u53c2\u7167) \u3001\u4eca\u56de\u306fPowerShell\u304b\u3089ClosedXML\u3092\u547c\u3073\u51fa\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002 \u203b \u4e0b\u8a18\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u524d\u306b [&hellip;]","protected":false},"author":1,"featured_media":7111,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"[PowerShell\u304b\u3089ClosedXML\u3092\u4f7f\u3063\u3066Excel\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\u65b9\u6cd5]","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,48,94],"tags":[],"class_list":["post-7187","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office","category-excel-office","category-powershell"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/eyecatch-Excel.png","jetpack_shortlink":"https:\/\/wp.me\/p4UZZr-1RV","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/7187","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7187"}],"version-history":[{"count":2,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/7187\/revisions"}],"predecessor-version":[{"id":7190,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/7187\/revisions\/7190"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/media\/7111"}],"wp:attachment":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7187"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7187"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7187"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}